diff --git a/include/ts/apidefs.h.in b/include/ts/apidefs.h.in index 49f5a83cd0b..7d976012eb3 100644 --- a/include/ts/apidefs.h.in +++ b/include/ts/apidefs.h.in @@ -196,6 +196,7 @@ typedef enum { TS_HTTP_STATUS_PRECONDITION_REQUIRED = 428, TS_HTTP_STATUS_TOO_MANY_REQUESTS = 429, TS_HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431, + TS_HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS = 451, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, TS_HTTP_STATUS_NOT_IMPLEMENTED = 501, TS_HTTP_STATUS_BAD_GATEWAY = 502, diff --git a/include/tscpp/api/HttpStatus.h b/include/tscpp/api/HttpStatus.h index 1fb3e15efe0..89f6dd8f945 100644 --- a/include/tscpp/api/HttpStatus.h +++ b/include/tscpp/api/HttpStatus.h @@ -82,6 +82,7 @@ enum HttpStatus { HTTP_STATUS_PRECONDITION_REQUIRED = 428, HTTP_STATUS_TOO_MANY_REQUESTS = 429, HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431, + HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS = 451, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, HTTP_STATUS_NOT_IMPLEMENTED = 501, diff --git a/iocore/net/I_NetVConnection.h b/iocore/net/I_NetVConnection.h index 1b35a1dbdf4..97df42ceb21 100644 --- a/iocore/net/I_NetVConnection.h +++ b/iocore/net/I_NetVConnection.h @@ -843,7 +843,7 @@ class NetVConnection : public VConnection, public PluginUserArgsmethod == HTTP_WKSIDX_OPTIONS) { HTTP_INCREMENT_DYN_STAT(http_options_requests_stat); - } else if (s->method == HTTP_WKSIDX_TRACE) { - HTTP_INCREMENT_DYN_STAT(http_trace_requests_stat); } else { HTTP_INCREMENT_DYN_STAT(http_extension_method_requests_stat); SET_VIA_STRING(VIA_DETAIL_TUNNEL, VIA_DETAIL_TUNNEL_METHOD); @@ -6844,7 +6842,7 @@ HttpTransact::handle_request_keep_alive_headers(State *s, HTTPVersion ver, HTTPH case KA_CONNECTION: ink_assert(s->current.server->keep_alive != HTTP_NO_KEEPALIVE); if (ver == HTTPVersion(1, 0)) { - if (s->current.request_to == PARENT_PROXY) { + if (s->current.request_to == PARENT_PROXY && s->parent_result.parent_is_proxy()) { heads->value_set(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION, "keep-alive", 10); } else { heads->value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, "keep-alive", 10); @@ -6858,7 +6856,7 @@ HttpTransact::handle_request_keep_alive_headers(State *s, HTTPVersion ver, HTTPH if (s->current.server->keep_alive != HTTP_NO_KEEPALIVE || (ver == HTTPVersion(1, 1))) { /* Had keep-alive */ s->current.server->keep_alive = HTTP_NO_KEEPALIVE; - if (s->current.request_to == PARENT_PROXY) { + if (s->current.request_to == PARENT_PROXY && s->parent_result.parent_is_proxy()) { heads->value_set(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION, "close", 5); } else { heads->value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, "close", 5); diff --git a/proxy/http2/HPACK.cc b/proxy/http2/HPACK.cc index 2ebaaee907b..eefdef255a5 100644 --- a/proxy/http2/HPACK.cc +++ b/proxy/http2/HPACK.cc @@ -691,7 +691,9 @@ decode_literal_header_field(MIMEFieldWrapper &header, const uint8_t *buf_start, // Decode header field name if (index) { - indexing_table.get_header_field(index, header); + if (indexing_table.get_header_field(index, header) == HPACK_ERROR_COMPRESSION_ERROR) { + return HPACK_ERROR_COMPRESSION_ERROR; + } } else { char *name_str = nullptr; uint64_t name_str_len = 0;