From 2b432e1f7129272c2a461cb51cb082dc77193b09 Mon Sep 17 00:00:00 2001 From: "mbelshe@chromium.org" Date: Tue, 8 Mar 2011 18:50:37 +0000 Subject: 2 Bug fixes: - Set-Cookie delimiter was a comma, but should have been a NUL. - Requests with query strings containing 'http://' caused request url paths to be truncated. Fix from Kevin Lindsay (kelindsay@gmail.com) BUG=none TEST=none Review URL: http://codereview.chromium.org/6628084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77310 0039d316-1c4b-4281-b951-d872f2087c98 --- net/tools/flip_server/spdy_interface.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'net/tools') diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc index 8136ebd..278f0dd 100644 --- a/net/tools/flip_server/spdy_interface.cc +++ b/net/tools/flip_server/spdy_interface.cc @@ -175,7 +175,15 @@ int SpdySM::SpdyHandleNewStream(const SpdyControlFrame* frame, *is_https_scheme = true; } - std::string uri = UrlUtilities::GetUrlPath(url->second); + // url->second here only ever seems to contain just the path. When this + // path contains a query string with a http:// in one of its values, + // UrlUtilities::GetUrlPath will fail and always return a / breaking + // the request. GetUrlPath assumes the absolute URL is being passed in. + std::string uri; + if (url->second.compare(0,4,"http") == 0) + uri = UrlUtilities::GetUrlPath(url->second); + else + uri = std::string(url->second); if (acceptor_->flip_handler_type_ == FLIP_HANDLER_SPDY_SERVER) { SpdyHeaderBlock::iterator referer = headers.find("referer"); std::string host = UrlUtilities::GetUrlHost(url->second); @@ -429,7 +437,7 @@ void SpdySM::CopyHeaders(SpdyHeaderBlock& dest, const BalsaHeaders& headers) { dest[hi->first.as_string()] = hi->second.as_string(); } else { dest[hi->first.as_string()] = ( - std::string(fhi->second.data(), fhi->second.size()) + "," + + std::string(fhi->second.data(), fhi->second.size()) + "\0" + std::string(hi->second.data(), hi->second.size())); } } -- cgit v1.1