diff --git a/src/shrpx_https_upstream.cc b/src/shrpx_https_upstream.cc index cb8918ad..c822d1ab 100644 --- a/src/shrpx_https_upstream.cc +++ b/src/shrpx_https_upstream.cc @@ -246,7 +246,6 @@ int htp_hdrs_completecb(http_parser *htp) { } auto downstream = upstream->get_downstream(); auto &req = downstream->request(); - auto &resp = downstream->response(); req.http_major = htp->http_major; req.http_minor = htp->http_minor; @@ -338,6 +337,8 @@ int htp_hdrs_completecb(http_parser *htp) { auto worker = handler->get_worker(); auto mruby_ctx = worker->get_mruby_context(); + auto &resp = downstream->response(); + if (mruby_ctx->run_on_request_proc(downstream) != 0) { resp.http_status = 500; return -1;