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

Add static factory method to AntPathRequestMather and RegexRequestMather #11965

Merged
merged 1 commit into from Oct 10, 2022

Conversation

marcusdacoregio
Copy link
Contributor

Closes gh-11938

@marcusdacoregio marcusdacoregio added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement labels Oct 6, 2022
@marcusdacoregio marcusdacoregio added this to the 5.8.0-RC1 milestone Oct 6, 2022
@marcusdacoregio marcusdacoregio self-assigned this Oct 6, 2022
* @param method the HTTP method to match. Must not be null.
* @since 5.8
*/
public static RegexRequestMatcher forMethod(HttpMethod method) {
Copy link
Member

Choose a reason for hiding this comment

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

Right now there is a problem if someone needs to do a static import for both AntPathRequestMatcher.forMethod and RegexRequestMatcher.forMethod the usage would need to be fully qualified. I'd say we should use antMatcher and regexMatcher for the method names.

Assert.notNull(method, "method cannot be null");
return new AntPathRequestMatcher(MATCH_ALL, method.name());
}

Copy link
Member

Choose a reason for hiding this comment

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

There doesn't seem to be a way to specify a pattern or a method and pattern via static factory method

Assert.notNull(method, "method cannot be null");
return new RegexRequestMatcher(".*", method.name());
}

Copy link
Member

Choose a reason for hiding this comment

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

There doesn't seem to be a static factory method for both the method and pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants