Add an option to disable GZIP.

This commit is contained in:
Chunting Gu
2019-04-22 14:43:46 +08:00
parent 88f5ae3c91
commit 2a868c4dc1
20 changed files with 130 additions and 74 deletions
+5
View File
@@ -158,6 +158,7 @@ void ClientSession::InitHeaders() {
// Content-Encoding Tokens:
// (https://en.wikipedia.org/wiki/HTTP_compression)
//
// * compress ¨C UNIX "compress" program method (historic; deprecated in most
// applications and replaced by gzip or deflate);
// * deflate ¨C compression based on the deflate algorithm, a combination of
@@ -177,7 +178,11 @@ void ClientSession::InitHeaders() {
// the raw deflate compressed data format.
// Simply put, "deflate" is not recommended for HTTP 1.1 encoding.
#if WEBCC_ENABLE_GZIP
headers_.Set(kAcceptEncoding, "gzip, deflate");
#else
headers_.Set(kAcceptEncoding, "identity");
#endif // WEBCC_ENABLE_GZIP
headers_.Set(kAccept, "*/*");