-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: interaction of Host and OpenAPI servers #36
Comments
The deep breath With that said, there is currently a huge void across all HTTP/HTML specs for applications that don't statically know what their canonical root path is. There's a similar issue for static client-side applications (especially single-page apps with routing) that may be served from any base path, such that an SPA being served from
All of that to say: HTTP is really not built to handle resources and servers that don't know their base URL in advance and attempting to do that with the way things currently are is going to make your life miserable in all sorts of ways. Don't try and use |
Just to clarify: I was referring to the This said, if I understand your point correctly (it is a lot of in depth information, I really appreciate it but will have to read it several times to absorb) routing based on |
Ah, my bad, reading Host capitalized in relation to the OAS server section made me jump to the conclusion that this is what you meant. I looked into this pretty in-depth a year or two back to try and untangle Starlette's Regardless of that, though, yes, Starlette's host-based routing runs the risk of having the same issues regarding reverse-proxies. I don't know how something like, say, Stack Overflow handles having their own multi-tenant application available from hundred of different domain names, though it clearly works for them.
I'm guessing they deal with the Host header at the edge and pass it to applicatons via some special header, but honestly I'm kind of at a loss. |
The way I usually do it is at the reverse proxy level. And then I add an environment variable that just hardcodes the host / path prefix so that I just concatenate that with the relativel path I want to redirect to. Regardless, it seem like the most prudent thing is probably to punt on this feature (and any Integrations specific to Host routing) unless someone comes asking for it with a convincing use case. Of course the routing part will still work (it's coming straight from Starlette), but it won't impact the OpenAPI docs or anything. |
Should they interact? If so, how are they related?
The text was updated successfully, but these errors were encountered: