Comments (3)
@dingjiayi Thanks for your report. I'd like to clarify one thing.
endpoint receive request with host head: Host: host_name:8080
Do you mean the Host
header as part of the Kong request log sent by the http-log plugin? Or the Host
header of the request that was used to send the Kong request log?
My understanding is that you configured the http-log plugins using http_endpoint="http://host_name:8080/log"
, and the logging server received a logging request from this plugin, and the Host
header of this request is host_name
instead of host_name:8080
. Am I right?
from kong.
My understanding is that you configured the http-log plugins using http_endpoint="http://host_name:8080/log", and the logging server received a logging request from this plugin, and the Host header of this request is host_name instead of host_name:8080. Am I right?
Right. Sorry for my unclear description.
This is caused by line 117 ["Host"] = host,
as blow
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.
from kong.
My understanding is that you configured the http-log plugins using http_endpoint="http://host_name:8080/log", and the logging server received a logging request from this plugin, and the Host header of this request is host_name instead of host_name:8080. Am I right?
Right. Sorry for my unclear description.
This is caused by line 117
["Host"] = host,
as blowkong/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
from kong.
Related Issues (20)
- Optional capture groups are broken with the request-transformer plugin and traditional_compatible router HOT 4
- Error in logs: failed to run timer HOT 4
- Database migration failed while using helm chart HOT 2
- JWT Plugin bypasses validation process occasionally on frequent requests HOT 4
- TLS SNI Route not work HOT 7
- Kong info, notice, inspect logs are all getting logged as error in GCP(google cloud platform) HOT 3
- Cannot use kong.db HOT 1
- Every time request localhost:8001/metrics, kong-cp-kong-pod will prompt a license-related error HOT 3
- Dataplane not getting information from the ControlPlane in Hybrid mode HOT 3
- go plugin error, worker-events: event callback failed; source=plugin_server, event=reset_instance HOT 1
- Error: attempt to index local 'ssl' (a nil value) for Kong >= 3.6.0 when KONG_PG_SSL=on HOT 6
- Handling two JWT signing keys for same iss HOT 1
- Documentation Improvement - Clarify Plugin Compatibility with Kong Versions](https://github.com/Kong/kong/issues/9999 HOT 1
- Error "error loading plugin schemas: on plugin <my-plugin>: <my-plugin> plugin is enabled but not installed" with Python plugin for kong HOT 6
- Where is kong 3.7.0 container image ? Can't find it on Dockerhub HOT 2
- Hola
- Inconsistent Rate Limiting Behavior Under High Load HOT 2
- No ability in plugin schema to have a record with dynamic fields HOT 2
- Changelog md no longer maintained? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kong.