diff options
author | Stefan Roehrich <sr@php.net> | 2002-06-02 21:35:06 +0000 |
---|---|---|
committer | Stefan Roehrich <sr@php.net> | 2002-06-02 21:35:06 +0000 |
commit | cce0d2f72d5a125bf7d7e74c60b38cc829ecabfc (patch) | |
tree | 7fad3e23751bf72e8e88044dbaf834e2771d1b81 | |
parent | ee44ad4f5b96ac7fe1ff0f528352a7e062ba8661 (diff) | |
download | php-git-cce0d2f72d5a125bf7d7e74c60b38cc829ecabfc.tar.gz |
Added "Vary: Accept-Encoding" header to zlib.output_compression
compressed output as with obgzhandler().
@ If zlib.output_compression is enabled and a page is compressed
@ a "Vary: Accept-Encoding" header is added. (Stefan)
# obgzhandler() sends this header, I think it is recommened by
# RFC 2616. If there are problems (e.g. with some browsers)
# it should be reverted.
-rw-r--r-- | ext/zlib/zlib.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index f69a570b0c..0ce9884a7b 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -971,11 +971,17 @@ int php_enable_output_compression(int buffer_size TSRMLS_DC) if (sapi_add_header("Content-Encoding: gzip", sizeof("Content-Encoding: gzip") - 1, 1)==FAILURE) { return FAILURE; } + if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1)==FAILURE) { + return FAILURE; + } ZLIBG(ob_gzip_coding) = CODING_GZIP; } else if(php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { if (sapi_add_header("Content-Encoding: deflate", sizeof("Content-Encoding: deflate") - 1, 1)==FAILURE) { return FAILURE; } + if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1)==FAILURE) { + return FAILURE; + } ZLIBG(ob_gzip_coding) = CODING_DEFLATE; } else { return FAILURE; |