Opened 12 years ago
Closed 12 years ago
#358 closed defect (duplicate)
HEAD request with Accept-Encoding: gzip returns a response body
Reported by: | bradfitz.com | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | 1.3.x |
Keywords: | Cc: | ||
uname -a: | |||
nginx -V: | nginx/1.2.1 |
Description
Hello, I'm the maintainer of the Go HTTP library.
It looks like nginx replies with a response body if a HEAD request contains Accept-Encoding gzip. (from https://code.google.com/p/go/issues/detail?id=5522)
Example:
$ telnet javascript.ru 80
Trying 176.9.67.226...
Connected to javascript.ru.
Escape character is ']'.
HEAD / HTTP/1.1
Host: javascript.ru
Accept-Encoding: gzip
HTTP/1.1 200 OK
Server: nginx/1.2.1
Date: Tue, 21 May 2013 20:50:44 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Set-Cookie: vblastvisit=1369169444; expires=Wed, 21-May-2014 20:50:44 GMT; path=/; domain=.javascript.ru
Set-Cookie: vblastactivity=0; expires=Wed, 21-May-2014 20:50:44 GMT; path=/; domain=.javascript.ru
Cache-Control: store, no-cache, must-revalidate
Pragma: private
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Tue, 21 May 2013 20:50:44 GMT
Cache-Control: post-check=0, pre-check=0
Content-Encoding: gzip
[binary data]q
But if I remove the Accept-Encoding header, then nginx does the right thing.
But nginx should probably just ignore it for HEAD.
Duplicate of #261. The issue should be fixed in 1.2.7+, 1.3.10+.