Skip to content

feat: allow providing a Prefix for paths to validate #40

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jamietanna
Copy link
Member

  • sq
  • sq
  • sq
  • sq

jamietanna and others added 4 commits April 25, 2025 08:01

r.RequestURI = strings.TrimPrefix(r.RequestURI, options.Prefix)
r.URL.Path = strings.TrimPrefix(r.URL.Path, options.Prefix)
r.URL.RawPath = strings.TrimPrefix(r.URL.RawPath, options.Prefix)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may not be needed

Comment on lines +234 to +235
r.RequestURI = strings.TrimPrefix(r.RequestURI, options.Prefix)
r.URL.Path = strings.TrimPrefix(r.URL.Path, options.Prefix)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally this should be a copy not the existing r, so we don't manipulate it before it goes into i.e. the error handler

Comment on lines +166 to +167
r.RequestURI = strings.TrimPrefix(r.RequestURI, options.Prefix)
r.URL.Path = strings.TrimPrefix(r.URL.Path, options.Prefix)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally this should be a copy not the existing r, so we don't manipulate it before it goes into i.e. the error handler

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