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/HttpRequestCommand.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/HttpRequestCommand.cc')
| -rw-r--r-- | src/HttpRequestCommand.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc index 407b0c38..4a7d3c8b 100644 --- a/src/HttpRequestCommand.cc +++ b/src/HttpRequestCommand.cc @@ -96,6 +96,11 @@ createHttpRequest(const SharedHandle<Request>& req, httpRequest->setProxyRequest(proxyRequest); httpRequest->addAcceptType(rg->getAcceptTypes().begin(), rg->getAcceptTypes().end()); + if(option->getAsBool(PREF_HTTP_ACCEPT_GZIP)) { + httpRequest->enableAcceptGZip(); + } else { + httpRequest->disableAcceptGZip(); + } if(option->getAsBool(PREF_HTTP_NO_CACHE)) { httpRequest->enableNoCache(); } else { |
