nghttp: Use method given in -H with ":method" in HTTP Upgrade
This commit is contained in:
parent
5e7e479c6c
commit
6958d0b55d
|
@ -813,7 +813,16 @@ int HttpClient::on_upgrade_connect() {
|
||||||
// If the request contains upload data, use OPTIONS * to upgrade
|
// If the request contains upload data, use OPTIONS * to upgrade
|
||||||
req = "OPTIONS *";
|
req = "OPTIONS *";
|
||||||
} else {
|
} else {
|
||||||
|
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 ";
|
req = "GET ";
|
||||||
|
} else {
|
||||||
|
req = (*meth).value;
|
||||||
|
req += " ";
|
||||||
|
}
|
||||||
req += reqvec[0]->make_reqpath();
|
req += reqvec[0]->make_reqpath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue