accept-encoding default to identity even if gzip is enabled.

This commit is contained in:
Chunting Gu
2020-09-14 13:25:04 +08:00
parent a827f4cfe2
commit 7a09d47e8f
6 changed files with 118 additions and 89 deletions
+13
View File
@@ -54,6 +54,19 @@ RequestPtr RequestBuilder::operator()() {
return request;
}
#if WEBCC_ENABLE_GZIP
// Accept Gzip compressed response data or not.
RequestBuilder& RequestBuilder::AcceptGzip(bool gzip) {
if (gzip) {
return Header(headers::kAcceptEncoding, "gzip, deflate");
} else {
return Header(headers::kAcceptEncoding, "identity");
}
}
#endif // WEBCC_ENABLE_GZIP
RequestBuilder& RequestBuilder::File(const bfs::path& path,
bool infer_media_type,
std::size_t chunk_size) {