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

Don't store the path prefix as global app state but derive it on a per-request basis #105

Open
mgoltzsche opened this issue Dec 27, 2024 · 0 comments

Comments

@mgoltzsche
Copy link

mgoltzsche commented Dec 27, 2024

Currently the path prefix is derived from the X-Forwarded-Prefix HTTP header of the first request only and then applied to every subsequent request (see here).
The header may be specified by a reverse-proxy that exposes the web app under a different path.

However, applying the prefix of the first request to all requests is a problem because:

  • when reconfiguring the reverse-proxy with a different prefix the change is not applied, unless the web app is restarted.
  • it does not allow using the web app with multiple path prefixes simultaneously (e.g. when letting a reverse-proxy expose it with a path prefix while still letting another client (such as a healthcheck) access the web app directly, bypassing the reverse-proxy).

Thus, I suggest to derive the path prefix on a per-request basis and to not store the result as global application state.

Relates to:

@mgoltzsche mgoltzsche changed the title Don't store the path prefix globally but evaluate it on a per-request basis Don't store the path prefix as global app state but derive it on a per-request basis Dec 27, 2024
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