nghttpx: Disable connect protocol if forward proxy is enabled
This commit is contained in:
parent
19d28365e9
commit
b6930e3d80
|
@ -391,7 +391,6 @@ int Http2Upstream::on_request_headers(Downstream *downstream,
|
|||
}
|
||||
}
|
||||
|
||||
if (!config->http2_proxy) {
|
||||
auto connect_proto = req.fs.header(http2::HD__PROTOCOL);
|
||||
if (connect_proto) {
|
||||
if (connect_proto->value != "websocket") {
|
||||
|
@ -402,7 +401,6 @@ int Http2Upstream::on_request_headers(Downstream *downstream,
|
|||
}
|
||||
req.connect_proto = CONNECT_PROTO_WEBSOCKET;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM)) {
|
||||
req.http2_expect_body = true;
|
||||
|
@ -1015,7 +1013,7 @@ Http2Upstream::Http2Upstream(ClientHandler *handler)
|
|||
|
||||
// TODO Maybe call from outside?
|
||||
std::array<nghttp2_settings_entry, 4> entry;
|
||||
size_t nentry = 3;
|
||||
size_t nentry = 2;
|
||||
|
||||
entry[0].settings_id = NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS;
|
||||
entry[0].value = http2conf.upstream.max_concurrent_streams;
|
||||
|
@ -1027,8 +1025,11 @@ Http2Upstream::Http2Upstream(ClientHandler *handler)
|
|||
entry[1].value = http2conf.upstream.window_size;
|
||||
}
|
||||
|
||||
entry[2].settings_id = NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL;
|
||||
entry[2].value = 1;
|
||||
if (!config->http2_proxy) {
|
||||
entry[nentry].settings_id = NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL;
|
||||
entry[nentry].value = 1;
|
||||
++nentry;
|
||||
}
|
||||
|
||||
if (http2conf.upstream.decoder_dynamic_table_size !=
|
||||
NGHTTP2_DEFAULT_HEADER_TABLE_SIZE) {
|
||||
|
|
Loading…
Reference in New Issue