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

Referer Regex #1862

Merged
merged 1 commit into from
Oct 25, 2023
Merged

Referer Regex #1862

merged 1 commit into from
Oct 25, 2023

Conversation

jakobvogel
Copy link
Member

Description

The dash is not necessary for production use, but for tests.

Checklist

  • Code change has been tested and works locally
  • Code was formatted via IntelliJ and follows SonarLint & best practices

The dash is not necessary for production use, but for tests.
@jakobvogel jakobvogel added 🐛 Bugfix Contains only a small fix for an existing bug 👶🏻 Trivial Easy to review labels Oct 25, 2023
@@ -705,7 +705,7 @@ protected void redirectToSaneReferer(final WebContext webContext, Pattern patter
* @see #redirectToSaneReferer(WebContext, Pattern, String)
*/
protected static Pattern createPatternForOverviewAndDetailRoutes(String overviewRoute, String detailRoutePrefix) {
return Pattern.compile("^(" + Pattern.quote(detailRoutePrefix) + "\\w+|" + Pattern.quote(overviewRoute) + ")$");
return Pattern.compile("^(" + Pattern.quote(detailRoutePrefix) + "[0-9a-zA-Z_\\-]+|" + Pattern.quote(overviewRoute) + ")$");
Copy link
Contributor

Choose a reason for hiding this comment

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

/user-accounts is a biz route using a dash 😇

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not talking about generic routes, but routes using identifiers or counters. These are AFAIK usually restricted to even A-Z0-9.

@jakobvogel jakobvogel merged commit faa8c7b into develop Oct 25, 2023
@jakobvogel jakobvogel deleted the feature/jvo/Regex branch October 25, 2023 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bugfix Contains only a small fix for an existing bug 👶🏻 Trivial Easy to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants