support for X-Forwarded-Host header #1034
Merged
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.
The X-Forwarded-Host is a de-facto standard header which is set by the reverse proxies.
This PR adds support for this header. It also adds supoprt to override the url during the wsql/xsd query (with inheriting from the WsdlFileOptions class) and allows to override the http scheme.
For example it is useful in the following configuration:
The service is accessible from the internet in the following url:
https://external.hostname.com/ServiceName
But it is only a proxy, calls the internal service:
http://internal.hostname.com/ServiceName
And we also have development and test urls:
https://test.hostname.com/ServiceName
http://internaltest.hostname.com/ServiceName
The proxy sets the X-Forwarded-Host header (external.hostname.com or test.hostname.com), and SoapCore overrides the http scheme to "http".
In this way the address in the wsdl will be correct even if it is called from the internet or from the internal url directly.