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. |
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

What this PR does / why we need it:
proxy_set_header Host $host may lose port info, use http_host instead.
Pre-submission checklist: