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

fix: use X-Forwarded-Uri if it exists for pathRegex match #1

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

mzndr
Copy link
Owner

@mzndr mzndr commented Jun 15, 2023

the functions isApiPath and isAllowedPath use the req.URL.Path property which leads to faulty behavior when behind a reverse proxy. The correct path can be inferred from the X-Forwarded-Uri header by making use of the already provided requestutil.GetRequestURI function.

Description

Motivation and Context

How Has This Been Tested?

Checklist:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.

the functions `isApiPath` and `isAllowedPath` use the `req.URL.Path` property which leads to faulty behavior when behind a reverse proxy. The correct path can be inferred from the `X-Forwarded-Uri` header by making use of the already provided `requestutil.GetRequestURI` function.

Co-authored-by: Jan Wystub <[email protected]>
@mzndr mzndr merged commit c2eb4a1 into master Jun 15, 2023
@mzndr mzndr deleted the fix-use-x-forwarded-uri-for-pathregex-match branch December 12, 2024 16:25
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.

1 participant