Commit d508a0c7 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Defer validation of request form after mruby handler

parent bc31146c
...@@ -350,11 +350,6 @@ int htp_hdrs_completecb(http_parser *htp) { ...@@ -350,11 +350,6 @@ int htp_hdrs_completecb(http_parser *htp) {
} }
// checking UF_HOST could be redundant, but just in case ... // checking UF_HOST could be redundant, but just in case ...
if (!(u.field_set & (1 << UF_SCHEMA)) || !(u.field_set & (1 << UF_HOST))) { if (!(u.field_set & (1 << UF_SCHEMA)) || !(u.field_set & (1 << UF_HOST))) {
if (get_config()->http2_proxy && !faddr->alt_mode) {
// Request URI should be absolute-form for client proxy mode
return -1;
}
req.no_authority = true; req.no_authority = true;
if (method == HTTP_OPTIONS && req.path == StringRef::from_lit("*")) { if (method == HTTP_OPTIONS && req.path == StringRef::from_lit("*")) {
...@@ -395,6 +390,11 @@ int htp_hdrs_completecb(http_parser *htp) { ...@@ -395,6 +390,11 @@ int htp_hdrs_completecb(http_parser *htp) {
// mruby hook may change method value // mruby hook may change method value
if (req.no_authority && get_config()->http2_proxy && !faddr->alt_mode) {
// Request URI should be absolute-form for client proxy mode
return -1;
}
if (downstream->get_response_state() == Downstream::MSG_COMPLETE) { if (downstream->get_response_state() == Downstream::MSG_COMPLETE) {
return 0; return 0;
} }
......
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