Merge branch 'Frefreak-master'

pull/1902/head
Tatsuhiro Tsujikawa 2022-04-03 18:59:24 +09:00
commit 85733e5980
6 changed files with 23 additions and 0 deletions

View File

@ -557,6 +557,10 @@ HTTP Specific Options
Use HEAD method for the first request to the HTTP server.
Default: ``false``
.. option:: --no-want-digest-header [true|false]
Whether to disable Want-Digest header when doing requests.
Default: ``false``
.. option:: -U, --user-agent=<USER_AGENT>

View File

@ -99,6 +99,8 @@ createHttpRequest(const std::shared_ptr<Request>& req,
httpRequest->setOption(option.get());
httpRequest->setProxyRequest(proxyRequest);
httpRequest->setAcceptMetalink(rg->getDownloadContext()->getAcceptMetalink());
httpRequest->setNoWantDigest(option->getAsBool(PREF_NO_WANT_DIGEST_HEADER));
if (option->getAsBool(PREF_HTTP_ACCEPT_GZIP)) {
httpRequest->enableAcceptGZip();
}

View File

@ -1205,6 +1205,16 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
op->setChangeOptionForReserved(true);
handlers.push_back(op);
}
{
OptionHandler* op(new BooleanOptionHandler(
PREF_NO_WANT_DIGEST_HEADER, TEXT_NO_WANT_DIGEST_HEADER, A2_V_FALSE,
OptionHandler::OPT_ARG));
op->addTag(TAG_HTTP);
op->setInitialOption(true);
op->setChangeGlobalOption(true);
op->setChangeOptionForReserved(true);
handlers.push_back(op);
}
{
OptionHandler* op(new DefaultOptionHandler(
PREF_USER_AGENT, TEXT_USER_AGENT, "aria2/" PACKAGE_VERSION, A2STR::NIL,

View File

@ -429,6 +429,8 @@ PrefPtr PREF_HTTP_ACCEPT_GZIP = makePref("http-accept-gzip");
// value: true | false
PrefPtr PREF_CONTENT_DISPOSITION_DEFAULT_UTF8 =
makePref("content-disposition-default-utf8");
// value: true | false
PrefPtr PREF_NO_WANT_DIGEST_HEADER = makePref("no-want-digest-header");
/**
* Proxy related preferences

View File

@ -381,6 +381,8 @@ extern PrefPtr PREF_HTTP_NO_CACHE;
extern PrefPtr PREF_HTTP_ACCEPT_GZIP;
// value: true | false
extern PrefPtr PREF_CONTENT_DISPOSITION_DEFAULT_UTF8;
// value: true | false
extern PrefPtr PREF_NO_WANT_DIGEST_HEADER;
/**;
* Proxy related preferences

View File

@ -539,6 +539,9 @@
#define TEXT_USE_HEAD \
_(" --use-head[=true|false] Use HEAD method for the first request to the HTTP\n" \
" server.")
#define TEXT_NO_WANT_DIGEST_HEADER \
_(" --no-want-digest-header[=true|false] Whether to disable Want-Digest header \n" \
" when doing requests.")
#define TEXT_CONTENT_DISPOSITION_DEFAULT_UTF8 \
_(" --content-disposition-default-utf8[=true|false] Handle quoted string in\n" \
" Content-Disposition header as UTF-8 instead of\n" \