From 445f25c466c64f206f5f141c56a1b7cf63f3a30b Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Tue, 30 Nov 2021 14:59:42 +0100 Subject: [PATCH] Use HttpMethod::valueOf in HttpMethod::resolve This commit makes sure that HttpMethod::resolve uses HttpMethod::valueOf and returns an HttpMethod for non-standard methods. See gh-27697 --- .../src/main/java/org/springframework/http/HttpMethod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-web/src/main/java/org/springframework/http/HttpMethod.java b/spring-web/src/main/java/org/springframework/http/HttpMethod.java index ba011e6d22..90557d4e10 100644 --- a/spring-web/src/main/java/org/springframework/http/HttpMethod.java +++ b/spring-web/src/main/java/org/springframework/http/HttpMethod.java @@ -146,7 +146,7 @@ public final class HttpMethod implements Comparable, Serializable { @Nullable @Deprecated public static HttpMethod resolve(@Nullable String method) { - return (method != null ? mappings.get(method) : null); + return (method != null ? valueOf(method) : null); }