From 6e6f8637d135abd633a921b4fc267d4bf7e1dca0 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Tue, 26 Jul 2022 14:44:51 +0300 Subject: [PATCH] Polishing contribution Closes gh-28771 --- .../springframework/http/server/ServletServerHttpRequest.java | 4 +--- .../web/util/ContentCachingRequestWrapper.java | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpRequest.java b/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpRequest.java index cd1eccf7aba..34a72977fcb 100644 --- a/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpRequest.java @@ -56,8 +56,6 @@ import org.springframework.util.StringUtils; */ public class ServletServerHttpRequest implements ServerHttpRequest { - protected static final String FORM_CONTENT_TYPE = MediaType.APPLICATION_FORM_URLENCODED_VALUE; - protected static final Charset FORM_CHARSET = StandardCharsets.UTF_8; @@ -231,7 +229,7 @@ public class ServletServerHttpRequest implements ServerHttpRequest { private static boolean isFormPost(HttpServletRequest request) { String contentType = request.getContentType(); - return (contentType != null && contentType.contains(FORM_CONTENT_TYPE) && + return (contentType != null && contentType.contains(MediaType.APPLICATION_FORM_URLENCODED_VALUE) && HttpMethod.POST.matches(request.getMethod())); } diff --git a/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java b/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java index 29d82e4ce44..748e11f64a5 100644 --- a/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java +++ b/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 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.