You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2010/09/16 16:53:41 UTC
svn commit: r997772 - in /trafficserver/traffic/trunk/proxy: hdrs/HTTP.cc
http2/HttpTransact.cc
Author: amc
Date: Thu Sep 16 14:53:41 2010
New Revision: 997772
URL: http://svn.apache.org/viewvc?rev=997772&view=rev
Log:
Fix for TS-438.
Modified:
trafficserver/traffic/trunk/proxy/hdrs/HTTP.cc
trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
Modified: trafficserver/traffic/trunk/proxy/hdrs/HTTP.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/hdrs/HTTP.cc?rev=997772&r1=997771&r2=997772&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/hdrs/HTTP.cc (original)
+++ trafficserver/traffic/trunk/proxy/hdrs/HTTP.cc Thu Sep 16 14:53:41 2010
@@ -1491,7 +1491,7 @@ HTTPHdr::_fill_target_cache() const
m_port = m_port * 10 + *colon - '0';
m_port_in_header = 0 != m_port;
}
- m_port = url_canonicalize_port(this->type_get(), m_port);
+ m_port = url_canonicalize_port(url->m_url_impl->m_url_type, m_port);
} else {
m_host_length = 0; // reset in case any earlier check corrupted it
}
Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc?rev=997772&r1=997771&r2=997772&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc Thu Sep 16 14:53:41 2010
@@ -1048,10 +1048,6 @@ HttpTransact::ModifyRequest(State * s)
////////////////////////////////////////////////
URL *url = request->url_get();
- hostname = request->host_get(&hostname_len);
- if (!request->is_target_in_url())
- s->hdr_info.client_req_is_server_style = true;
-
s->orig_scheme = (scheme = url->scheme_get_wksidx());
s->method = s->hdr_info.client_request.method_get_wksidx();
@@ -1068,6 +1064,15 @@ HttpTransact::ModifyRequest(State * s)
if (s->method == HTTP_WKSIDX_CONNECT && !request->is_port_in_header())
url->port_set(80);
+ // Ugly - this must come after the call to url->scheme_set or
+ // it can't get the scheme properly and the wrong data is cached.
+ // The solution should be to move the scheme detecting logic in to
+ // the header class, rather than doing it in a random bit of
+ // external code.
+ hostname = request->host_get(&hostname_len);
+ if (!request->is_target_in_url())
+ s->hdr_info.client_req_is_server_style = true;
+
// If the incoming request is proxy-style AND contains a Host header,
// then remove the Host header to prevent content spoofing.