Commit 6958d0b5 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttp: Use method given in -H with ":method" in HTTP Upgrade

parent 5e7e479c
......@@ -813,7 +813,16 @@ int HttpClient::on_upgrade_connect() {
// If the request contains upload data, use OPTIONS * to upgrade
req = "OPTIONS *";
} else {
req = "GET ";
auto meth = std::find_if(
std::begin(config.headers), std::end(config.headers),
[](const Header &kv) { return util::strieq_l(":method", kv.name); });
if (meth == std::end(config.headers)) {
req = "GET ";
} else {
req = (*meth).value;
req += " ";
}
req += reqvec[0]->make_reqpath();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment