diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-04-02 14:16:10 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-04-02 14:16:10 +0000 |
| commit | 6996f07f5f7b70c8644344658dde5d164d2b0da0 (patch) | |
| tree | 8d93a3ad61254bb729dc865caeaf8528f5c17572 /src/HttpRequest.cc | |
| parent | 5cc28b2d8003b0838513d968cb2a9339410e2041 (diff) | |
2010-04-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't send "Accept: default, gzip" by default. This is because
some server responds with "Content-Encoding: gzip" for files which
itself is gzipped file and aria2 inflates them. This is a problem
if user don't want to inflate the file. Apparently this is server
configuration error, but I cannot do anything about this. So turn
this off. Added --http-accept-gzip option. If true is given to
this option, aria2 sends 'Accept: deflate, gzip' request header
and inflates response if remote server responds with
'Content-Encoding: gzip' or 'Content-Encoding: deflate'. This
indicates we removed extension tgz hack in order not to inflate
files with tgz extensions.
* doc/aria2c.1.txt
* src/HttpRequest.cc
* src/HttpRequest.h
* src/HttpRequestCommand.cc
* src/HttpResponseCommand.cc
* src/OptionHandlerFactory.cc
* src/prefs.cc
* src/prefs.h
* src/usage_text.h
* test/HttpRequestTest.cc
Diffstat (limited to 'src/HttpRequest.cc')
| -rw-r--r-- | src/HttpRequest.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index e3123eb6..c6c0afbf 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -57,7 +57,8 @@ const std::string HttpRequest::USER_AGENT("aria2"); HttpRequest::HttpRequest():_contentEncodingEnabled(true), userAgent(USER_AGENT), - _noCache(true) + _noCache(true), + _acceptGzip(false) {} void HttpRequest::setSegment(const SharedHandle<Segment>& segment) @@ -169,7 +170,9 @@ std::string HttpRequest::createRequest() if(_contentEncodingEnabled) { std::string acceptableEncodings; #ifdef HAVE_LIBZ - acceptableEncodings += "deflate, gzip"; + if(_acceptGzip) { + acceptableEncodings += "deflate, gzip"; + } #endif // HAVE_LIBZ if(!acceptableEncodings.empty()) { builtinHds.push_back |
