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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/sirius/biz/web/BizController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.

}

/**
Expand Down