File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
org.springframework.web/src
main/java/org/springframework/http
test/java/org/springframework/http Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -376,7 +376,12 @@ else if (!isQuotedString(value)) {
376376 }
377377
378378 private boolean isQuotedString (String s ) {
379- return s .length () > 1 && s .startsWith ("\" " ) && s .endsWith ("\" " ) ;
379+ if (s .length () < 2 ) {
380+ return false ;
381+ }
382+ else {
383+ return ((s .startsWith ("\" " ) && s .endsWith ("\" " )) || (s .startsWith ("'" ) && s .endsWith ("'" )));
384+ }
380385 }
381386
382387 private String unquote (String s ) {
Original file line number Diff line number Diff line change @@ -181,6 +181,14 @@ public void parseMediaTypeQuotedParameterValue() {
181181 assertEquals ("\" v>alue\" " , mediaType .getParameter ("attr" ));
182182 }
183183
184+ // SPR-8917
185+
186+ @ Test
187+ public void parseMediaTypeSingleQuotedParameterValue () {
188+ MediaType mediaType = MediaType .parseMediaType ("audio/*;attr='v>alue'" );
189+ assertEquals ("'v>alue'" , mediaType .getParameter ("attr" ));
190+ }
191+
184192 @ Test (expected = IllegalArgumentException .class )
185193 public void parseMediaTypeIllegalQuotedParameterValue () {
186194 MediaType .parseMediaType ("audio/*;attr=\" " );
You can’t perform that action at this time.
0 commit comments