File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/java/co/zeroae/gate Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,9 @@ static String asJson(Map<String, Object> obj) {
3535 }
3636
3737 static String ensureValidRequestContentType (String contentType ) throws GateException {
38- final String rv = contentType .equals ("application/json" ) ? "text/json" : contentType ;
39- if (!DocumentFormat .getSupportedMimeTypes ().contains (rv )) {
38+ final MimeType mimeType = DocumentFormat .getMimeTypeForString (
39+ contentType .equals ("application/json" ) ? "text/json" : contentType );
40+ if (mimeType == null ) {
4041 throw new GateException (
4142 "Unsupported MIME type " + contentType + " valid options are "
4243 + Arrays .toString (DocumentFormat .getSupportedMimeTypes ()
@@ -46,7 +47,7 @@ static String ensureValidRequestContentType(String contentType) throws GateExcep
4647 .toArray ())
4748 );
4849 }
49- return rv ;
50+ return mimeType . toString () ;
5051 }
5152
5253 static String ensureValidResponseType (String acceptHeader ) throws GateException {
You can’t perform that action at this time.
0 commit comments