Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP 1.0 responses are HTTP 1.1 and broken: content-length and transfer-encoding header is missing. #26

Open
niko opened this issue Nov 9, 2017 · 0 comments

Comments

@niko
Copy link

niko commented Nov 9, 2017

When doing HTTP 1.1 requests ngx_http_substitutions_filter_module removes the content-length header and adds transfer-encoding: chunked. That's perfectly fine.

When doing HTTP 1.0 requests ngx_http_substitutions_filter_module just removes the content-length header while still announcing a HTTP 1.1 response.

curl -i0 172.17.104.12/station/eins 
*   Trying 172.17.104.12...
* Connected to 172.17.104.12 (172.17.104.12) port 80 (#0)
> GET /station/eins HTTP/1.0
> Host: 172.17.104.12
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 09 Nov 2017 13:30:04 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Vary: Accept-Encoding
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: ANY
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 1728000
Cache-Control: public, must-revalidate, max-age=3582
Expires: Thu, 09 Nov 2017 14:00:14 GMT
X-FRONTEND: http
X-BACKEND: api_backend
X-BACKEND-SERVER: api_172.17.104.8:3000
X-Varnish: 17730207 17302980
Age: 1773
Via: 1.1 varnish-v4
Location: 
X-Cache: HIT
X-Cache-Hits: 78
Accept-Ranges: bytes

[body]

(note that I have mixed the output of curl and curl -v for clarity)

You can see that curl issues a HTTP 1.0 request and gets a broken HTTP 1.1 answer.

Some clients (we have user reports of PHPs file_gets_content) break with a response like that.

We're using bc58cb1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant