Skip to content

The single-arg constructor in AntPathRequestMatcher is creating a case-sensitive matcher #4260

Closed
@jkilroy

Description

@jkilroy

java doc for public AntPathRequestMatcher(String pattern) says
"Creates a matcher with the specific pattern which will match all HTTP methods in a
case insensitive manner." This was true in previous versions, but now it is not.

This calls another overloaded constructor which in turn passes the caseSensitive arg = true to
AntPathRequestMatcher(String pattern, String httpMethod, boolean caseSensitive)

In previous versions, the caseSensitive arg was set to false:

Here's the 4.02 code:

/**
 * Creates a matcher with the specific pattern which will match all HTTP methods in a
 * case insensitive manner.
 *
 * @param pattern the ant pattern to use for matching
 */
public AntPathRequestMatcher(String pattern) {
	this(pattern, null);
}

/**
 * Creates a matcher with the supplied pattern and HTTP method in a case insensitive
 * manner.
 *
 * @param pattern the ant pattern to use for matching
 * @param httpMethod the HTTP method. The {@code matches} method will return false if
 * the incoming request doesn't have the same method.
 */
public AntPathRequestMatcher(String pattern, String httpMethod) {
	this(pattern, httpMethod, false);
}

/**
 * Creates a matcher with the supplied pattern which will match the specified Http
 * method
 *
 * @param pattern the ant pattern to use for matching
 * @param httpMethod the HTTP method. The {@code matches} method will return false if
 * the incoming request doesn't doesn't have the same method.
 * @param caseSensitive true if the matcher should consider case, else false
 */
public AntPathRequestMatcher(String pattern, String httpMethod, boolean caseSensitive)

Metadata

Metadata

Assignees

Labels

in: docsAn issue in Documentation or samplesstatus: duplicateA duplicate of another issuetype: bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions