Uses Charset instead of String in MimeType.equals()
Prior to this commit, Spring's MimeType checked for equality between two MIME types based on the equality of their properties maps; however, the properties maps contain string representations of the "charset" values. Thus, "UTF-8" is never equal to "utf-8" which breaks the contract for character set names which must be compared in a case-insensitive manner. This commit addresses this issue by ensuring that "charset" properties in MimeType instances are compared as Java Charset instances, thereby ignoring case when checking for equality between charset names. Issue: SPR-13157
This commit is contained in:
@@ -56,7 +56,7 @@ public class AbstractJettyServerTestCase {
|
||||
|
||||
protected static final String baseUrl = "http://localhost:" + port;
|
||||
|
||||
protected static final MediaType textContentType = new MediaType("text", "plain", Collections.singletonMap("charset", "utf-8"));
|
||||
protected static final MediaType textContentType = new MediaType("text", "plain", Collections.singletonMap("charset", "UTF-8"));
|
||||
|
||||
protected static final MediaType jsonContentType = new MediaType("application", "json", Collections.singletonMap("charset", "utf-8"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user