-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content-Length header addition #2209
Comments
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 <ai@tempesta-tech.com>
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:
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. |
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 <ai@tempesta-tech.com>
Also there is PR726 in tempesta-test |
In PR2243 we partly removed Content-length header for HTTP2. In the future we need to remove the rest of the places where this header is added. Also we need to correct tests (look for __prepare_chunked_expected_response function in framework/deproxy_auto_parser.py). The first part of this task about not optimal behavior was done in PR2243. |
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 <ai@tempesta-tech.com>
Do not add Content-Length header for HTTP2 responses (#2209)
#2243 doesn't fully fix the problem |
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.Upd: The first part of this task about not optimal behavior was done in PR2243.
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: