Commit e8c608a4 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Fix bug that PUT is replaced with POST

parent 338b4ba7
...@@ -75,9 +75,6 @@ int htp_msg_begin(http_parser *htp) { ...@@ -75,9 +75,6 @@ int htp_msg_begin(http_parser *htp) {
auto downstream = auto downstream =
make_unique<Downstream>(upstream, handler->get_mcpool(), 0, 0); make_unique<Downstream>(upstream, handler->get_mcpool(), 0, 0);
// We happen to have the same value for method token.
downstream->set_request_method(htp->method);
upstream->attach_downstream(std::move(downstream)); upstream->attach_downstream(std::move(downstream));
return 0; return 0;
...@@ -88,6 +85,10 @@ namespace { ...@@ -88,6 +85,10 @@ namespace {
int htp_uricb(http_parser *htp, const char *data, size_t len) { int htp_uricb(http_parser *htp, const char *data, size_t len) {
auto upstream = static_cast<HttpsUpstream *>(htp->data); auto upstream = static_cast<HttpsUpstream *>(htp->data);
auto downstream = upstream->get_downstream(); auto downstream = upstream->get_downstream();
// We happen to have the same value for method token.
downstream->set_request_method(htp->method);
if (downstream->get_request_headers_sum() + len > if (downstream->get_request_headers_sum() + len >
get_config()->header_field_buffer) { get_config()->header_field_buffer) {
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
......
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