mirror of https://github.com/aria2/aria2
2010-10-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't append slash in CookieStorage::criteriaFind(). Append file part of URI to request-uri in HttpRequest::createRequest(). This change reverts the part of the previous change:"The request-path must be ends with '/' so that request-path '/foo/' path-matches cookie-path '/foo' and '/foo/' in the proposed algorithm." * src/CookieStorage.cc * src/HttpRequest.ccpull/1/head
parent
8b17d4b276
commit
b8f8a14937
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2010-10-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Don't append slash in CookieStorage::criteriaFind(). Append file
|
||||||
|
part of URI to request-uri in HttpRequest::createRequest(). This
|
||||||
|
change reverts the part of the previous change:"The
|
||||||
|
request-path must be ends with '/' so that request-path '/foo/'
|
||||||
|
path-matches cookie-path '/foo' and '/foo/' in the proposed
|
||||||
|
algorithm."
|
||||||
|
* src/CookieStorage.cc
|
||||||
|
* src/HttpRequest.cc
|
||||||
|
|
||||||
2010-10-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-10-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Rewritten Cookie class and Cookie parser based on
|
Rewritten Cookie class and Cookie parser based on
|
||||||
|
|
|
@ -246,12 +246,10 @@ std::vector<Cookie> CookieStorage::criteriaFind
|
||||||
if(requestPath.empty()) {
|
if(requestPath.empty()) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
std::string normRequestPath =
|
|
||||||
requestPath == A2STR::SLASH_C?requestPath:requestPath+A2STR::SLASH_C;
|
|
||||||
if(util::isNumericHost(requestHost)) {
|
if(util::isNumericHost(requestHost)) {
|
||||||
searchCookieByDomainSuffix
|
searchCookieByDomainSuffix
|
||||||
(requestHost, domains_.begin(), domains_.end(), std::back_inserter(res),
|
(requestHost, domains_.begin(), domains_.end(), std::back_inserter(res),
|
||||||
requestHost, normRequestPath, now, secure);
|
requestHost, requestPath, now, secure);
|
||||||
} else {
|
} else {
|
||||||
std::vector<std::string> levels;
|
std::vector<std::string> levels;
|
||||||
util::split(requestHost, std::back_inserter(levels),A2STR::DOT_C);
|
util::split(requestHost, std::back_inserter(levels),A2STR::DOT_C);
|
||||||
|
@ -263,7 +261,7 @@ std::vector<Cookie> CookieStorage::criteriaFind
|
||||||
domain.insert(domain.begin(), (*i).begin(), (*i).end());
|
domain.insert(domain.begin(), (*i).begin(), (*i).end());
|
||||||
searchCookieByDomainSuffix
|
searchCookieByDomainSuffix
|
||||||
(domain, domains_.begin(), domains_.end(),
|
(domain, domains_.begin(), domains_.end(),
|
||||||
std::back_inserter(res), requestHost, normRequestPath, now, secure);
|
std::back_inserter(res), requestHost, requestPath, now, secure);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::vector<CookiePathDivider> divs;
|
std::vector<CookiePathDivider> divs;
|
||||||
|
|
|
@ -225,11 +225,13 @@ std::string HttpRequest::createRequest()
|
||||||
if(!cookieStorage_.isNull()) {
|
if(!cookieStorage_.isNull()) {
|
||||||
std::string cookiesValue;
|
std::string cookiesValue;
|
||||||
std::vector<Cookie> cookies =
|
std::vector<Cookie> cookies =
|
||||||
cookieStorage_->criteriaFind(getHost(),
|
cookieStorage_->criteriaFind
|
||||||
getDir(),
|
(getHost(),
|
||||||
Time().getTime(),
|
getDir() == A2STR::SLASH_C?
|
||||||
getProtocol() == Request::PROTO_HTTPS ?
|
getDir()+getFile():strconcat(getDir(), A2STR::SLASH_C, getFile()),
|
||||||
true : false);
|
Time().getTime(),
|
||||||
|
getProtocol() == Request::PROTO_HTTPS ?
|
||||||
|
true : false);
|
||||||
for(std::vector<Cookie>::const_iterator itr = cookies.begin(),
|
for(std::vector<Cookie>::const_iterator itr = cookies.begin(),
|
||||||
eoi = cookies.end(); itr != eoi; ++itr) {
|
eoi = cookies.end(); itr != eoi; ++itr) {
|
||||||
strappend(cookiesValue, (*itr).toString(), ";");
|
strappend(cookiesValue, (*itr).toString(), ";");
|
||||||
|
|
Loading…
Reference in New Issue