Don't modify user-agent
This commit is contained in:
parent
ac84b68189
commit
4ac689526b
|
@ -203,16 +203,11 @@ int Downstream::push_request_headers()
|
||||||
hdrs += "Host: ";
|
hdrs += "Host: ";
|
||||||
hdrs += get_config()->downstream_hostport;
|
hdrs += get_config()->downstream_hostport;
|
||||||
hdrs += "\r\n";
|
hdrs += "\r\n";
|
||||||
// TODO Rewrite user-agent?
|
|
||||||
for(Headers::const_iterator i = request_headers_.begin();
|
for(Headers::const_iterator i = request_headers_.begin();
|
||||||
i != request_headers_.end(); ++i) {
|
i != request_headers_.end(); ++i) {
|
||||||
if(util::strieq((*i).first.c_str(), "X-Forwarded-Proto")) {
|
if(util::strieq((*i).first.c_str(), "X-Forwarded-Proto")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(util::strieq((*i).first.c_str(), "user-agent")) {
|
|
||||||
hdrs += "User-Agent: ";
|
|
||||||
hdrs += get_config()->server_name;
|
|
||||||
} else {
|
|
||||||
hdrs += (*i).first;
|
hdrs += (*i).first;
|
||||||
hdrs += ": ";
|
hdrs += ": ";
|
||||||
hdrs += (*i).second;
|
hdrs += (*i).second;
|
||||||
|
@ -221,7 +216,6 @@ int Downstream::push_request_headers()
|
||||||
hdrs += ", ";
|
hdrs += ", ";
|
||||||
hdrs += upstream_->get_client_handler()->get_ipaddr();
|
hdrs += upstream_->get_client_handler()->get_ipaddr();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
hdrs += "\r\n";
|
hdrs += "\r\n";
|
||||||
}
|
}
|
||||||
hdrs += "Connection: close\r\n";
|
hdrs += "Connection: close\r\n";
|
||||||
|
|
Loading…
Reference in New Issue