-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: proxy_set_header Host $host may lose port info #2079
Conversation
pls add test cases |
@halfcrazy |
And is this PR anything with |
Since we use proxy_set_header to set the Host field in header for upstream server. Nginx $host variable doesn't contain a port, as rfc2616 a request to ports besides 80, 443 should always include a port in the host field. [1]https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23 |
Sorry, I have no idea how to add a test for this case. |
you can add test cases to test if port exists. |
@halfcrazy https://github.com/apache/apisix/blob/master/.travis/apisix_cli_test.sh you can take a look at this |
f2a5437
to
18faaaf
Compare
Test case added. |
"proxy_set_header Host $host may lose port info, use http_host instead." we need to add test for this case |
ping @halfcrazy @membphis |
Hi, May I ask the conclusion of this question? tks @halfcrazy |
There's a lot of change to apisix template since this pr, the $host indeed should change to $http_host but I don't familiar with Perl style test cant write a test for this. |
let us reopen this PR, I think @Firstsawyou can help you, all right? @Firstsawyou |
Let me see. |
18faaaf
to
2ad03af
Compare
hi @halfcrazy |
a821462
to
bea7853
Compare
0696740
to
603dd9e
Compare
603dd9e
to
6c93810
Compare
e94041f
to
972200a
Compare
972200a
to
0cb4cda
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.
LGTM
What this PR does / why we need it:
proxy_set_header Host $host may lose port info, use http_host instead.
Pre-submission checklist: