Fix HandlerMappingIntrospector uri matching
Prior to this commit, the `HandlerMappingIntrospector` would comparea request with a cached request by using `String#matches` on their String URI. This could lead to `PatternSyntaxException` exceptions at runtime if the request URI contained pattern characters. This commit fixes this typo to use `String#equals` instead. Fixes gh-31946
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -399,7 +399,7 @@ public class HandlerMappingIntrospector
|
||||
|
||||
public boolean matches(HttpServletRequest request) {
|
||||
return (this.dispatcherType.equals(request.getDispatcherType()) &&
|
||||
this.requestURI.matches(request.getRequestURI()));
|
||||
this.requestURI.equals(request.getRequestURI()));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user