]> git.kaiwu.me - nginx.git/commitdiff
Handling of Content-Encoding set from perl.
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 11 Oct 2011 18:01:38 +0000 (18:01 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 11 Oct 2011 18:01:38 +0000 (18:01 +0000)
This fixes double gzipping in case of gzip filter being enabled while perl
returns already gzipped response.

src/http/modules/perl/nginx.xs

index c07118bb6b8795e9c25c89239a24ba431b16448f..e3a9dd5c9fdd9ede26eec1a8810539cdf634d80e 100644 (file)
@@ -474,6 +474,13 @@ header_out(r, key, value)
         r->headers_out.content_length = header;
     }
 
+    if (header->key.len == sizeof("Content-Encoding") - 1
+        && ngx_strncasecmp(header->key.data, "Content-Encoding",
+                           sizeof("Content-Encoding") - 1) == 0)
+    {
+        r->headers_out.content_encoding = header;
+    }
+
 
 void
 filename(r)