Skip to content

Commit 5535311

Browse files
committed
fix #777 by loosening Format.getFromMimetype to only require mimeType to startWith the appropriate string -- allows for Content-Type headers that have a semicolon followed by charset
1 parent f209cfd commit 5535311

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/com/marklogic/client/io/Format.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ public String getDefaultMimetype() {
6565

6666
public static Format getFromMimetype(String mimeType) {
6767
if ( mimeType == null ) return UNKNOWN;
68-
else if ( "application/xml".equals(mimeType) ) return XML;
69-
else if ( "text/xml".equals(mimeType) ) return XML;
70-
else if ( "application/json".equals(mimeType) ) return JSON;
71-
else if ( "text/xml".equals(mimeType) ) return JSON;
72-
else if ( "application/octet-stream".equals(mimeType) ) return BINARY;
68+
else if ( mimeType.startsWith("application/xml") ) return XML;
69+
else if ( mimeType.startsWith("text/xml") ) return XML;
70+
else if ( mimeType.startsWith("application/json") ) return JSON;
71+
else if ( mimeType.startsWith("text/xml") ) return JSON;
72+
else if ( mimeType.startsWith("application/octet-stream") ) return BINARY;
7373
else if ( mimeType.startsWith("text/") ) return TEXT;
7474
else return UNKNOWN;
7575
}

0 commit comments

Comments
 (0)