Skip to content

Commit

Permalink
Remove content-length header if present
Browse files Browse the repository at this point in the history
The content length is already handled internally. Leaving it specified causes strange `400 bad request` errors from the destination server. See: bogdanfinn/tls-client#147.
  • Loading branch information
sleeyax committed Feb 26, 2025
1 parent 0fb4ef2 commit 2d21248
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src-go/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func StartServer(addr string) error {
req.URL.Scheme = config.Scheme
req.RequestURI = ""
req.Header[fhttp.HeaderOrderKey] = config.HeaderOrder
// The content-length header is already set by the client (internally).
// Leaving it here causes strange '400 bad request' errors from the destination, so we remove it.
req.Header.Del("Content-Length")

res, err := client.Do(req)
if err != nil {
Expand Down

0 comments on commit 2d21248

Please sign in to comment.