-
Notifications
You must be signed in to change notification settings - Fork 3k
inets: Remove default empty TE header from HTTP requests #10120
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
Conversation
CT Test Results 2 files 22 suites 10m 4s ⏱️ Results for commit 2fab8cc. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts
// Erlang/OTP Github Action Bot |
ab6adfa to
f314280
Compare
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.
Pull Request Overview
This PR removes the automatic addition of empty TE (Transfer-Encoding) headers from HTTP/1.1 requests to improve RFC 2616 compliance and resolve compatibility issues with proxy servers that drop requests containing empty TE headers.
Key changes:
- Removes automatic empty TE header injection for HTTP/1.1 requests
- Adds proper TE header handling that modifies the Connection header when TE is explicitly provided
- Implements comprehensive test coverage for various TE header scenarios
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
lib/inets/test/httpc_SUITE.erl |
Adds extensive test cases for TE header behavior and Connection header modifications |
lib/inets/src/http_lib/http_util.erl |
Adds utility function to parse Connection header tokens |
lib/inets/src/http_client/httpc_request.erl |
Updates connection closing logic to properly parse Connection header tokens |
lib/inets/src/http_client/httpc_handler.erl |
Removes automatic empty TE header from TLS tunnel requests |
lib/inets/src/http_client/httpc.erl |
Replaces automatic TE header injection with proper TE/Connection header coordination |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Thanks for the contribution. Change looks good to me. Please replace the strip with trim, and I think it's good to go |
|
Hi, there seems to be an error in all of the added testcases, when run in group sim_http_ipv6. All tests fail with connection header "close". |
f314280 to
5ccc3c5
Compare
I have not: I need to figure out how to get those running. They were skipping for me locally. I'd assumed those would be unrelated to my change, but if they were breaking, would be caught in CI. Just so I understand: CI has passed all tests. Are the ipv6 tests not run there? |
|
Ipv6 tests are also skipped in GH actions. Other machines; not visible here have these tests running and all of them, are failing there. |
|
Got it - I will resolve. Thanks for the review! |
5ccc3c5 to
d758fbb
Compare
|
Thanks for the fix. Could you rebase your changes since there is a merge conflict in httpc_SUITE? |
|
@Whaileee - please take another look - tests passing on my side. I changed ipv6 to not send per-request connection options ( otp/lib/inets/src/http_client/httpc_manager.erl Lines 743 to 760 in 286418c
Rather than change Let me know if these test pass now. |
d758fbb to
b3e3364
Compare
|
Whoops my bad, there wasn't a conflict (yet). Sorry! |
b3e3364 to
8dc0871
Compare
|
Thanks! The internal tests are ran overnight so we need to wait a day for them. Change looks good to me. If the tests pass, then we are merging! |
|
@Whaileee How'd the tests go? |
|
Well, they definitely would have ran better with the testing label on 😅. I forgot to reapply that yesterday |
|
@Whaileee Any luck? |
|
For some reason the branch was still commented out of testing. I've now added it manually, so if it's not in testing now I'll start breaking stuff (just kidding). Therefore I ask for another day of patience. |
|
No problem! 🙏 |
|
Is today the day? 🙏 I have a good feeling 😄 |
|
We will see. The tests on the machines with ipv6 are still running. Should be done in a few hours |
|
2 out of 3 passed, I suspect in an hour we will see the rest also finish |
|
3 out of 3. It's ready to be sent to the wild! |
8dc0871 to
cd629f6
Compare
|
I rebased it to patch-base-26 so it can be easliy backported, and removed dangling whitespaces. |
cd629f6 to
c1e39d2
Compare
ad43f78 to
4ee1e2d
Compare
The httpc client was unconditionally setting the TE header to an empty string on all HTTP/1.1 requests when no TE header was explicitly provided. This behavior violated RFC 2616 and caused compatibility issues with some proxy servers that would drop requests containing empty TE headers. RFC 2616 does not require a TE header to be present, and when absent, no transfer encoding expectations should be assumed. This change removes the automatic addition of empty TE headers, allowing httpc to send cleaner HTTP requests that better comply with the standard. Fixes erlangGH-10065
4ee1e2d to
2fab8cc
Compare
|
Great! Thank you! So in the next minor patch of OTP 26, 27 or 28, this will be pulled in? |
|
That is true for 26 and 27, but for 28 it will be in 28.1 |
|
🙏 |
|
Just to clarify: by minor patch, do we mean ~quarterly minor patches? |
|
This branch will be released with OTP 27.3.4.3 and OTP 26.2.5.15 which are planned to be released soon, as well as OTP 28.1 which will be also released soon-ish. |
The httpc client was unconditionally setting the TE header to an empty string on all HTTP/1.1 requests when no TE header was explicitly provided. This behavior violated RFC 2616 and caused compatibility issues with some proxy servers that would drop requests containing empty TE headers.
RFC 2616 does not require a TE header to be present, and when absent, no transfer encoding expectations should be assumed. This change removes the automatic addition of empty TE headers, allowing httpc to send cleaner HTTP requests that better comply with the standard.
Fixes GH-10065