nghttpx: Allow link header server push for HTTP/2 backend as well

This commit is contained in:
Tatsuhiro Tsujikawa 2015-09-06 15:12:20 +09:00
parent 75b98662be
commit 28defbfb4a
1 changed files with 5 additions and 8 deletions

View File

@ -1381,12 +1381,9 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) {
// We need some conditions that must be fulfilled to initiate server // We need some conditions that must be fulfilled to initiate server
// push. // push.
// //
// * Server push is disabled for http2 proxy, since incoming headers // * Server push is disabled for http2 proxy or client proxy, since
// are mixed origins. We don't know how to reliably determine the // incoming headers are mixed origins. We don't know how to
// authority yet. // reliably determine the authority yet.
//
// * If downstream is http/2, it is likely that PUSH_PROMISE is
// coming from there, so we don't initiate PUSH_RPOMISE here.
// //
// * We need 200 response code for associated resource. This is too // * We need 200 response code for associated resource. This is too
// restrictive, we will review this later. // restrictive, we will review this later.
@ -1397,8 +1394,8 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) {
if (!get_config()->no_server_push && if (!get_config()->no_server_push &&
nghttp2_session_get_remote_settings(session_, nghttp2_session_get_remote_settings(session_,
NGHTTP2_SETTINGS_ENABLE_PUSH) == 1 && NGHTTP2_SETTINGS_ENABLE_PUSH) == 1 &&
get_config()->downstream_proto == PROTO_HTTP && !get_config()->http2_proxy && !get_config()->client_proxy &&
!get_config()->http2_proxy && (downstream->get_stream_id() % 2) && (downstream->get_stream_id() % 2) &&
downstream->get_response_header(http2::HD_LINK) && downstream->get_response_header(http2::HD_LINK) &&
downstream->get_response_http_status() == 200 && downstream->get_response_http_status() == 200 &&
(downstream->get_request_method() == HTTP_GET || (downstream->get_request_method() == HTTP_GET ||