Skip to content

Commit

Permalink
Always set content-length
Browse files Browse the repository at this point in the history
Not setting it makes some clients unhappy.
  • Loading branch information
SeanTAllen committed Feb 4, 2024
1 parent 0802950 commit 2b8df83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .release-notes/set-content-length.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Always set Content-Length

There was a bug where the Content-Length header could end up not being sent. This would cause many clients (such as curl) to hang.
4 changes: 2 additions & 2 deletions http_server/response.pony
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ class val BuildableResponse is (Response & ByteSeqIter)
match cl
| let clu: USize =>
set_header("Content-Length", cl.string())
// | None =>
// TODO: drop header
| None =>
set_header("Content-Length", 0)
end
this

Expand Down

0 comments on commit 2b8df83

Please sign in to comment.