mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-23 22:06:12 +03:00
net: Allow overriding CONNECT authority with header
The -connect-authority header overrides the CONNECT authority field. The Cronet bidirectional_stream API does not have a way to pass in this field to support tunnels, so it has to be smuggled in via a header.
This commit is contained in:
parent
26be49ca7b
commit
c4e6fbf2a2
@ -111,6 +111,10 @@ void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
|
|||||||
HttpRequestHeaders::Iterator it(request_headers);
|
HttpRequestHeaders::Iterator it(request_headers);
|
||||||
while (it.GetNext()) {
|
while (it.GetNext()) {
|
||||||
std::string name = base::ToLowerASCII(it.name());
|
std::string name = base::ToLowerASCII(it.name());
|
||||||
|
if (info.method == "CONNECT" && name == "-connect-authority") {
|
||||||
|
(*headers)[spdy::kHttp2AuthorityHeader] = it.value();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (name.empty() || name[0] == ':' || name == "connection" ||
|
if (name.empty() || name[0] == ':' || name == "connection" ||
|
||||||
name == "proxy-connection" || name == "transfer-encoding" ||
|
name == "proxy-connection" || name == "transfer-encoding" ||
|
||||||
name == "host") {
|
name == "host") {
|
||||||
|
Loading…
Reference in New Issue
Block a user