You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possibly related to #4060, @ezrast and I found when hacking -when using the compress handler, the response has no body when using curl or browsers; removing the accept encoding headers, things work as expected.
$ crystal -v
Crystal 0.21.0 (2017-02-21)
Code:
require"http/server"require"http/server/handlers/compress_handler"
server =HTTP::Server.new("localhost", 3000, [HTTP::CompressHandler.new]
) do |context|
context.response.status_code =200
context.response <<%{<html><body><p>HAI: #{context.request.path}.</body></html>}endputs"Launching server at http://localhost:3000"puts"Press Ctrl+C to exit"
server.listen
Bug:
$ curl --compressed -vv http://localhost:3000/
* Trying ::1...
* Connected to localhost (::1) port 3000 (#0)
> GET / HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.49.1
> Accept: */*
> Accept-Encoding: deflate, gzip
>
< HTTP/1.1 200 OK
< Connection: keep-alive
< Content-Encoding: gzip
< Content-Length: 54
<
* Connection #0 to host localhost left intact
without compression things work as expected:
$ curl -vv http://localhost:3000/
* Trying ::1...
* Connected to localhost (::1) port 3000 (#0)
> GET / HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.49.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Connection: keep-alive
< Content-Length: 40
<
<html><body>
<p>HAI: /.
</body></html>
* Connection #0 to host localhost left intact
The text was updated successfully, but these errors were encountered:
Possibly related to #4060, @ezrast and I found when hacking -when using the compress handler, the response has no body when using curl or browsers; removing the accept encoding headers, things work as expected.
Code:
Bug:
without compression things work as expected:
The text was updated successfully, but these errors were encountered: