-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
http-log plugin: Host header not including port #13067
Comments
@dingjiayi Thanks for your report. I'd like to clarify one thing.
Do you mean the My understanding is that you configured the http-log plugins using |
Right. Sorry for my unclear description. This is caused by line 117 kong/kong/plugins/http-log/handler.lua Lines 116 to 121 in 4e006aa
If it's confirmed to be a bug, I would be willing to submit a PR to fix it. I think it could be resolved by directly removing the code on line 117. Just like many other HTTP client libraries, lua-resty-http automatically sets the Host header in the underlying layer when the upper-layer request doesn't have a Host header set. |
I think this is a bug, PR is welcome. @dingjiayi |
Is there an existing issue for this?
Kong version (
$ kong version
)Kong 3.6
Current Behavior
use http-log plugin with config
http_endpoint="http://host_name:8080/log"
endpoint receive request with host head:
Host: host_name
Expected Behavior
endpoint receive request with host head:
Host: host_name:8080
From the RFC , we can see the Host header should include the port.
If no port is included, the default port for the service requested is implied (e.g., 443 for an HTTPS URL, and 80 for an HTTP URL).
Steps To Reproduce
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: