nghttpx: Fix bug that PUT is replaced with POST

This commit is contained in:
Tatsuhiro Tsujikawa 2015-10-15 00:56:41 +09:00
parent 338b4ba739
commit e8c608a4d9
1 changed files with 4 additions and 3 deletions

View File

@ -75,9 +75,6 @@ int htp_msg_begin(http_parser *htp) {
auto downstream =
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));
return 0;
@ -88,6 +85,10 @@ namespace {
int htp_uricb(http_parser *htp, const char *data, size_t len) {
auto upstream = static_cast<HttpsUpstream *>(htp->data);
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 >
get_config()->header_field_buffer) {
if (LOG_ENABLED(INFO)) {