"X-Forwarded-Host" header is ignored in version 0.2.0
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Description
In version 0.2.0, when passing a "X-Forwarded-Host" header to the "/anything" endpoint (and perhaps other endpoints), it is does not affect the "url" property of the response body.
Steps to Reproduce
- Run the v0.2.0 docker container:
docker run -p 61234:80 kong/httpbin:0.2.0 - Make a get request to "http://localhost:61234/anything", including the header "X-Forwarded-Host" with the value "localhost:8299"
- The response body contains
"url": "http://localhost:61234/anything"
Expected Behavior
The response body should contain "url": "http://localhost:8299/anything". This is the behavior in both local docker kong/httpbin:v0.1.0 and when calling httpbin.org/anything.
Actual Behavior
The response body contains "url": "http://localhost:61234/anything", ignoring the value passed in X-Forwarded-Host header.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the v0.2.0 Docker container and reproduce the request against the /anything endpoint with X-Forwarded-Host set to localhost:8299. Compare the response with v0.1.0 and httpbin.org; the work is done when the response URL uses the forwarded host.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100