Skip to content

Commit

Permalink
dont send "Transfer-Encoding" => "chunked" to HTTP/1.0 clients
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Oct 1, 2018
1 parent ba1062d commit a1e92ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Streams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ function IOExtras.startwrite(http::Stream)
if !hasheader(m, "Content-Length") &&
!hasheader(m, "Transfer-Encoding") &&
!hasheader(m, "Upgrade") &&
(m isa Request || bodylength(m) > 0)
(m isa Request || (m.request.version >= v"1.1" && bodylength(m) > 0))

http.writechunked = true
setheader(m, "Transfer-Encoding" => "chunked")
else
Expand Down

0 comments on commit a1e92ca

Please sign in to comment.