Skip to content

Commit

Permalink
chore(client/http): rm "Connection: close" header
Browse files Browse the repository at this point in the history
Magic of undocumented features.
  • Loading branch information
haruue committed May 30, 2024
1 parent e1ac7c8 commit 23b7968
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/internal/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ func sendSimpleResponse(conn net.Conn, req *http.Request, statusCode int) error
Header: http.Header{},
}
// Remove the "Content-Length: 0" header, some clients (e.g. ffmpeg) may not like it.
// NOTE: This will also cause go/http to add a "Connection: close" header, but seems to be fine.
resp.ContentLength = -1
// Also, prevent the "Connection: close" header.
resp.Close = false
resp.Uncompressed = true
return resp.Write(conn)
}

Expand Down

0 comments on commit 23b7968

Please sign in to comment.