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

HTTP Header Host and swagger.json #789

Open
FloLaco opened this issue Mar 26, 2020 · 1 comment
Open

HTTP Header Host and swagger.json #789

FloLaco opened this issue Mar 26, 2020 · 1 comment
Labels

Comments

@FloLaco
Copy link

FloLaco commented Mar 26, 2020

I suspect that swagger is using the HTTP Header "Host xxxxx.com" to return the swagger.json file.
I can't find anything on the doncumentation to avoid this behavior.

Context

Info: I've change url in the exemple, so you may find screenshot and text different
I've an application deployed on a container behind 2 reverse proxy (one in the cloud env and one on kubernetes).
My URL application deployment on the kubernetes reverse proxy is (for exemple) : test1.dsrauto.prj.kube.test.com

I would like to expose my application with this url : network-api-pprod.test.com (more easy to use)
So, on the second revers proxy (HA Proxy), I've configured to listen on network-api-pprod.test.com and send trafic to the other reverse proxy (the kube). But for it can work, I've to add an header into http-request, like this (don't look the format, I'm justing using api to configure HAProxy):

{
  "fqdn": "network-api-pprod.test.com",
  "mode": "http",
  "backend": [
    "http-request set-header Host test1.dsrauto.prj.kube.test.com",
    "server srv x.x.x.x:443 weight 1 maxconn 100 ssl verify none check"
  ],
  "subdomains": "false"
}

If you look the network inspection, my browser is trying to get all swagger resource with the correct url (network-api-pprod.test.com) but only the swagger.json is trying to get on the HTTP Header Host url (test1.dsrauto.prj.kube.test.com).

image

Environment

  • Python version : Python 2.7.16
  • Flask version : Flask 1.1.1
  • Flask-RESTPlus version 0.13.0
  • Other installed Flask extensions
@FloLaco FloLaco added the bug label Mar 26, 2020
@carscan
Copy link

carscan commented Apr 4, 2020

@FloLaco is there any temporary fix available to avoid this from happing?

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

No branches or pull requests

2 participants