From b8f8a14937b76e3498a3a3acf381c0d6af641ab9 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 9 Oct 2010 14:38:47 +0000 Subject: 2010-10-09 Tatsuhiro Tsujikawa 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 --- src/HttpRequest.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/HttpRequest.cc') diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index 3e50ba0f..557b2163 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -225,11 +225,13 @@ std::string HttpRequest::createRequest() if(!cookieStorage_.isNull()) { std::string cookiesValue; std::vector cookies = - cookieStorage_->criteriaFind(getHost(), - getDir(), - Time().getTime(), - getProtocol() == Request::PROTO_HTTPS ? - true : false); + cookieStorage_->criteriaFind + (getHost(), + getDir() == A2STR::SLASH_C? + getDir()+getFile():strconcat(getDir(), A2STR::SLASH_C, getFile()), + Time().getTime(), + getProtocol() == Request::PROTO_HTTPS ? + true : false); for(std::vector::const_iterator itr = cookies.begin(), eoi = cookies.end(); itr != eoi; ++itr) { strappend(cookiesValue, (*itr).toString(), ";"); -- cgit