Polishing contribution

Closes gh-34993
This commit is contained in:
Brian Clozel
2026-08-20 14:13:55 +02:00
parent 4a64537ac6
commit 2730d77f82
5 changed files with 10 additions and 21 deletions
@@ -124,18 +124,17 @@ public class HttpHeaders implements Serializable {
* @see <a href="https://tools.ietf.org/html/rfc5789#section-3.1">Section 3.1 of RFC 5789</a>
*/
public static final String ACCEPT_PATCH = "Accept-Patch";
/**
* The HTTP {@code Accept-Ranges} header field name.
* @see <a href="https://tools.ietf.org/html/rfc7233#section-2.3">Section 5.3.5 of RFC 7233</a>
*/
public static final String ACCEPT_RANGES = "Accept-Ranges";
/**
* The HTTP {@code Accept-Query} header field name.
* @since 7.1
* @see <a href="https://www.rfc-editor.org/rfc/rfc10008.html#section-3">Section 3 of RFC 10008</a>
*/
public static final String ACCEPT_QUERY = "Accept-Query";
/**
* The HTTP {@code Accept-Ranges} header field name.
* @see <a href="https://tools.ietf.org/html/rfc7233#section-2.3">Section 5.3.5 of RFC 7233</a>
*/
public static final String ACCEPT_RANGES = "Accept-Ranges";
/**
* The CORS {@code Access-Control-Allow-Credentials} response header field name.
* @see <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>
@@ -132,7 +132,7 @@ public class HttpMediaTypeNotSupportedException extends HttpMediaTypeException {
if (HttpMethod.PATCH.equals(this.httpMethod)) {
headers.setAcceptPatch(getSupportedMediaTypes());
}
if (HttpMethod.QUERY.equals(this.httpMethod)) {
else if (HttpMethod.QUERY.equals(this.httpMethod)) {
headers.setAcceptQuery(getSupportedMediaTypes());
}
return headers;
@@ -161,7 +161,7 @@ public class UnsupportedMediaTypeStatusException extends ResponseStatusException
if (this.method == HttpMethod.PATCH) {
headers.setAcceptPatch(this.supportedMediaTypes);
}
if (this.method == HttpMethod.QUERY) {
else if (this.method == HttpMethod.QUERY) {
headers.setAcceptQuery(this.supportedMediaTypes);
}
return headers;
@@ -113,11 +113,6 @@ public class MvcAnnotationPredicates {
return new RequestMappingPredicate(path).method(RequestMethod.HEAD);
}
public static RequestMappingPredicate queryMapping(String... path) {
return new RequestMappingPredicate(path).method(RequestMethod.QUERY);
}
public static class ModelAttributePredicate implements Predicate<MethodParameter> {