Commit 1b63e6d4 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Call request phase hook for pushed resource as well

parent 28defbfb
......@@ -289,7 +289,10 @@ and :rb:attr:`Nghttpx::Env#resp` respectively.
method is noop. *uri* can be absolute URI, absolute path or
relative path to the current request. For absolute or
relative path, scheme and authority are inherited from the
current request. Currently, method is always GET.
current request. Currently, method is always GET. nghttpx
will issue request to backend servers to fulfill this request.
The request and response phase hooks will be called for pushed
resource as well.
.. rb:class:: Response
......
......@@ -587,6 +587,20 @@ int on_frame_send_callback(nghttp2_session *session, const nghttp2_frame *frame,
// downstream is in pending queue.
auto ptr = downstream.get();
upstream->add_pending_downstream(std::move(downstream));
#ifdef HAVE_MRUBY
auto worker = handler->get_worker();
auto mruby_ctx = worker->get_mruby_context();
if (mruby_ctx->run_on_request_proc(ptr) != 0) {
if (upstream->error_reply(ptr, 500) != 0) {
upstream->rst_stream(ptr, NGHTTP2_INTERNAL_ERROR);
return 0;
}
return 0;
}
#endif // HAVE_MRUBY
upstream->start_downstream(ptr);
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