Skip to content
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

support for X-Forwarded-Host header #1034

Merged
merged 1 commit into from
Mar 7, 2024
Merged

support for X-Forwarded-Host header #1034

merged 1 commit into from
Mar 7, 2024

Conversation

zgabi
Copy link

@zgabi zgabi commented Mar 5, 2024

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.

allow to override the HTTP scheme and allow to override the url when the wsdl query is called
@andersjonsson
Copy link
Collaborator

andersjonsson commented Mar 5, 2024

Would it be easier to add a Func<HttpContext, string> UrlOverrideFunc that one can set instead of using inheritance?
Either way is fine by me, I just wanted to put the option out there

@zgabi
Copy link
Author

zgabi commented Mar 5, 2024

Ok, I'll modify it today evening or tomorrow (I can't do it right now) Please do not merge it until than.

@andersjonsson andersjonsson merged commit a5dd30a into DigDes:develop Mar 7, 2024
3 checks passed
@andersjonsson
Copy link
Collaborator

Oh god damn it... I'm too tired and accidently merged the wrong PR. I'm sorry... 😞

@andersjonsson
Copy link
Collaborator

andersjonsson commented Mar 7, 2024

Reverted the PR but I'm afraid you'll have to resubmit a PR

@zgabi
Copy link
Author

zgabi commented Mar 7, 2024

Sorry, my yesterday was very busy... I do it now.. sumbit a new PR in some hours... thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants