This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new 51ed9c22a1 Use Reader instead of explicit StringReader 51ed9c22a1 is described below commit 51ed9c22a1944d4bcfc0aaf3df4a69b023e0f544 Author: Christopher Schultz <ch...@christopherschultz.net> AuthorDate: Wed Jun 18 11:35:10 2025 -0400 Use Reader instead of explicit StringReader Avoid double-assignment --- java/org/apache/tomcat/util/http/parser/MediaType.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/java/org/apache/tomcat/util/http/parser/MediaType.java b/java/org/apache/tomcat/util/http/parser/MediaType.java index ff2a5f76d8..fc37f30761 100644 --- a/java/org/apache/tomcat/util/http/parser/MediaType.java +++ b/java/org/apache/tomcat/util/http/parser/MediaType.java @@ -17,7 +17,7 @@ package org.apache.tomcat.util.http.parser; import java.io.IOException; -import java.io.StringReader; +import java.io.Reader; import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; @@ -124,7 +124,7 @@ public class MediaType { * * @throws IOException if there was a problem reading the input */ - public static MediaType parseMediaType(StringReader input) throws IOException { + public static MediaType parseMediaType(Reader input) throws IOException { // Type (required) String type = HttpParser.readToken(input); @@ -151,9 +151,11 @@ public class MediaType { while (lookForSemiColon == SkipResult.FOUND) { String attribute = HttpParser.readToken(input); - String value = ""; + String value; if (HttpParser.skipConstant(input, "=") == SkipResult.FOUND) { value = HttpParser.readTokenOrQuotedString(input, true); + } else { + value = ""; } if (attribute != null) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org