]> git.kaiwu.me - nginx.git/commitdiff
Merge of r4991: fixed proxied HEAD requests with gzip enabled.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 11 Feb 2013 14:39:49 +0000 (14:39 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 11 Feb 2013 14:39:49 +0000 (14:39 +0000)
Fixed HEAD requests handling when proxying is used (ticket #261).

src/http/modules/ngx_http_gzip_filter_module.c
src/http/ngx_http_upstream.c

index 964f4fd272c21ab7d0f2c753f77da72cb48a0dbb..f70987ee6fdf210a6e749977b837466ee2f074ee 100644 (file)
@@ -320,7 +320,7 @@ ngx_http_gzip_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
 
     ctx = ngx_http_get_module_ctx(r, ngx_http_gzip_filter_module);
 
-    if (ctx == NULL || ctx->done) {
+    if (ctx == NULL || ctx->done || r->header_only) {
         return ngx_http_next_body_filter(r, in);
     }
 
index 5e04324d753546cb55e45905fdd00c53a37be95a..3436c6b1d94579cab76beb268d33363b82c3b5f8 100644 (file)
@@ -3099,6 +3099,7 @@ ngx_http_upstream_finalize_request(ngx_http_request_t *r,
     r->connection->log->action = "sending to client";
 
     if (rc == 0
+        && !r->header_only
 #if (NGX_HTTP_CACHE)
         && !r->cached
 #endif