Skip to content

Conversation

dianlight
Copy link
Contributor

In a SSE connection ( chunked HTTP with infinite body ) the connection drop or go in panic after maxSize.
Also framework like huma use ResponseController to set DeadLine to control.

  • Truncate body when exceeding maxSize in Write method
  • Implement SetWriteDeadline for better response control
  • Use new(bytes.Buffer) for body initialization

* Truncate body when exceeding maxSize in Write method
* Implement SetWriteDeadline for better response control
* Use new(bytes.Buffer) for body initialization
* Eliminated `SetWriteDeadline` from `bodyWriter`
* Cleaned up imports by removing `fmt` and `time`
samber added a commit to samber/slog-gin that referenced this pull request Aug 28, 2025
samber added a commit to samber/slog-chi that referenced this pull request Aug 28, 2025
samber added a commit to samber/slog-echo that referenced this pull request Aug 28, 2025
@samber
Copy link
Owner

samber commented Aug 28, 2025

thanks!

@samber samber merged commit f6a1a47 into samber:main Aug 28, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants