feat: add ability to specify Host header in the Custom API widget #882
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently we cannot use reverse proxies in the Custom API as we cannot pass the
Hostheader in theheadersfield. This is becausenet/httpignores theHostheader and uses thereq.Hostfield instead: golang/go#7682.This PR adds the support for it. The change is backward compatible. Tested with Traefik as the reverse proxy in my environment and confirmed that it's working.
Another option was to search for the
Hostheader in theheadersfield and set that inreq.Hostbut that would not be backward compatible.