lifo/cramp — Issue #36: No output when using Rack::Deflater
Author: GBH
Created: 2011-10-26 16:16:42+00:00
State: open

It seems that thin doesn't serve content properly *unless* it was generated via `halt`

Normal request with compression off:

[12:13:56][oleg@Liger:~]$ curl -N -v http://localhost:3000
* About to connect() to localhost port 3000 (#0)
* Trying ::1... Connection refused
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Connection: keep-alive
< Vary: Accept-Encoding
< Server: thin 1.2.11 codename Bat-Shit Crazy
* no chunk, no close, no size. Assume close to signal end
<
{"message":"Invalid URI"}* Closing connection #0

With compression enabled I see no response content:

[12:14:17][oleg@Liger:~]$ curl -N -v --compress http://localhost:3000
* About to connect() to localhost port 3000 (#0)
* Trying ::1... Connection refused
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
> Accept-Encoding: deflate, gzip
>
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Connection: keep-alive
< Vary: Accept-Encoding
< Content-Encoding: deflate
< Server: thin 1.2.11 codename Bat-Shit Crazy
* no chunk, no close, no size. Assume close to signal end
<
* Closing connection #0

However if my app outputs content via `halt` it seems to work:

[12:14:56][oleg@Liger:~]$ curl -N -v --compress http://localhost:3000/v1/users
* About to connect() to localhost port 3000 (#0)
* Trying ::1... Connection refused
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET /v1/users HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
> Accept-Encoding: deflate, gzip
>
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Vary: Accept-Encoding
< Content-Encoding: deflate
< Connection: close
< Server: thin 1.2.11 codename Bat-Shit Crazy
<
{"message":"No API key provided"}* Closing connection #0

Any idea what this might be?