You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some not optimal behavior. In case when Content-Length not listed in response headers and upstream server indicates message finishing by closing connection in function tfw_http_resp_terminate() we add Content-Length header.
But for http2 protocol we call tfw_h2_msg_cutoff_headers() and after HPack encode headers, it implies we must not add the header in tfw_http_resp_terminate() but add this header during http2 message adjusting.
The text was updated successfully, but these errors were encountered:
The Content-Length header should not be added for HTTP2 responses in
tfw_http_resp_terminate(), as it is ultimately removed by the
tfw_h2_msg_cutoff_headers() function. Skip the Content-Length header
addition for HTTP2 clients to avoid unnecessary operations.
Signed-off-by: Alexander Ivanov <[email protected]>
It looks we can just skip Content-Length addition for HTTP2 in tfw_http_resp_terminate().
As for addition this header field during http2 message adjusting, we add this field in tfw_h2_resp_encode_headers() only for chunked responses:
if (test_bit(TFW_HTTP_B_CHUNKED, resp->flags)) {
if (unlikely(tfw_h2_add_hdr_clen(resp)))
goto clean;
}
I'm not sure what behavior is desired. RFC 3119 says nothing about content-length usage. It's a completely optional field. This issue looks independent, and we could discuss it separately.
We have some not optimal behavior. In case when
Content-Length
not listed in response headers and upstream server indicates message finishing by closing connection in functiontfw_http_resp_terminate()
we addContent-Length
header.But for http2 protocol we call
tfw_h2_msg_cutoff_headers()
and after HPack encode headers, it implies we must not add the header intfw_http_resp_terminate()
but add this header during http2 message adjusting.The text was updated successfully, but these errors were encountered: