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 #634

Open
mathiasi opened this issue Dec 14, 2023 · 1 comment
Open

Support for X-Forwarded-Host #634

mathiasi opened this issue Dec 14, 2023 · 1 comment

Comments

@mathiasi
Copy link

Describe the issue
We have Function Apps that are accessed through a Front Door. This gives us some trouble with the URL in the swagger UI as the URL is being resolved to the direct URL of the Function App which is not what we want as it is not accessible and everything should go through the Front Door. Is there a way to configure the URL being set in the Swagger UI? As far as I can tell this is the logic that sets it and it doesn't appear there is a way to change it:

var baseUrl = $"{this._req.GetScheme(options)}://{this._req.Host}{prefix}";

I know that the Front Door will send X-Forwarded-Host and X-Forwarded-Proto which we were able to use with older the older Swashbuckle library which we used for In-Process Function Apps.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy Function App
  2. Configure Front Door
  3. Try to access Swagger UI through Front Door
  4. Observe non-Front Door URL being used

Expected behavior
Front Door URL should be used

Screenshots
image

@mathiasi
Copy link
Author

I realize that it is actually possible to change the value by manually specifying the server using the configuration. I'll leave this open for somebody else to judge if it is a good idea to support the header anyway. But I found a "workaround".

@mathiasi mathiasi reopened this Dec 15, 2023
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

No branches or pull requests

1 participant