feat: introduces an option for a custom body size in websocket.Dial function#548
feat: introduces an option for a custom body size in websocket.Dial function#548IgorSilvestre wants to merge 2 commits intocoder:masterfrom
Conversation
…dy capture in `Dial`
…or nil body handling
|
Closing this as it does not address #528, which does not request an increase in body size. |
Fair, I assumed in
that he would want to return more of the body, seeing its already returning 1024b. |
|
@IgorSilvestre no worries. Thanks for attempting a fix. We are very conservative with expanding API surface in this project and there would have to be a real and obvious need if we were to add something. |
On reading other issues I saw that minimizing the API is something important for you, no problem. I really like this project, if ever need a hand with something just ask. |
Why
Feature asked by this issue:
What
DialOptions.MaxErrorResponseBodyBytesso callers can opt into more (or zero) error-bodybytes when the handshake fails, enabling better branching on status/body while keeping the default
1024-byte limit.
still guards error-body reads; disabled option closes without reading.
Key Changes
still close original body with 3s fail-safe.
status code presence, and nil-body safety.
Testing
I did some testing with a dummy server responding a fixed status 400 and a 1mb body:
