diff --git a/src/shrpx_https_upstream.cc b/src/shrpx_https_upstream.cc index eb6942c9..6332b29f 100644 --- a/src/shrpx_https_upstream.cc +++ b/src/shrpx_https_upstream.cc @@ -350,11 +350,6 @@ int htp_hdrs_completecb(http_parser *htp) { } // checking UF_HOST could be redundant, but just in case ... 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; if (method == HTTP_OPTIONS && req.path == StringRef::from_lit("*")) { @@ -395,6 +390,11 @@ int htp_hdrs_completecb(http_parser *htp) { // 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) { return 0; }