-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix(1902): correct trailer headers placement #650
base: master
Are you sure you want to change the base?
Conversation
456ef6e
to
11ba65c
Compare
bf820f2
to
743de58
Compare
7b57b03
to
5116147
Compare
framework/deproxy_client.py
Outdated
@@ -416,6 +420,12 @@ class ReqBodyBuffer: | |||
|
|||
|
|||
class DeproxyClientH2(BaseDeproxyClient): | |||
_ping_received = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable should add to _reinit_variables
method and remove here. We must to reset the counter when we use start method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes fixed
helpers/deproxy.py
Outdated
@@ -439,9 +439,19 @@ def read_chunked_body(self, stream): | |||
# Parsing trailer will eat last CRLF | |||
self.parse_trailer(stream) | |||
|
|||
def convert_chunked_body(self): | |||
def convert_chunked_body(self, http2, trailers, method_is_head): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can get value for trailers
using self
:
trailers = len(self.trailer.headers)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes fixed, unnecessary variable
@parameterize.expand( | ||
[ | ||
param( | ||
name="empty_body", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we need these tests for http1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes fixed
http2_general/test_h2_frame.py
Outdated
util.wait_until( | ||
lambda: client.ping_received != ping_count, | ||
5, | ||
abort_cond=lambda: client.state != stateful.STATE_STARTED, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the new wait_for_*
method to DeproxyClientH2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes fixed
79ae44e
to
2afef56
Compare
01aa410
to
3f9274c
Compare
3f9274c
to
dba1ef7
Compare
e4c9814
to
846efba
Compare
Check how Tempesta FW calculate http2 connection and stream window when response contains trailers
Implement tests to check how Tempesta FW satisfy http2 requests from cache if response is for http1 request with trailers and vise versa.
If response or request contains trailers with hop by hop headers, Tempesta FW should remove this headers. Also Tempesta FW should remove hop by bop headers from 'Trailer' header.
- Remove hop by hop headers from trailers - Remove hop by jop headers from 'Trailer' header. - Do not add last "\r\n" to the chunked body, if trailers doesn't exist, it break deproxy autoparser.
76c3471
to
8b02af5
Compare
- Remove 'Trailer' header for http1 and http2 requests/response. - Drop 'http1' requests/responses if trailer headers contain hop by hop headers.
8b02af5
to
bb581e7
Compare
Check that we drop requests (http1 and http2) if there is a hop-by-hop headers in trailers (check all headers from the list RFC 9110 7.6.1). Also disable some tests on TCP segmentation.
47f52b0
to
630654e
Compare
630654e
to
ba2decf
Compare
test for tempesta-tech/tempesta#2173