@@ -366,13 +366,8 @@ baos, new Deflater(Deflater.DEFAULT_COMPRESSION,
366366 JSONObject response = new JSONObject ();
367367
368368 String contentType = request .getContentType ();
369- if (contentType == null ||
370- contentType .equals ("application/json" )) {
371- ByteArrayOutputStream baos = new ByteArrayOutputStream ();
372- Utils .copy (is , baos );
373- response .put ("data" , new String (
374- baos .toByteArray (), StandardCharsets .UTF_8 ));
375- } else if (contentType .startsWith ("multipart/form-data" )) {
369+ if (contentType != null && contentType .startsWith (
370+ "multipart/form-data" )) {
376371 MultiPartInputStreamParser parser =
377372 new MultiPartInputStreamParser (
378373 is , contentType , null , null );
@@ -389,9 +384,10 @@ baos, new Deflater(Deflater.DEFAULT_COMPRESSION,
389384 }
390385 response .put ("data" , data );
391386 } else {
392- servletResponse .setStatus (501 );
393- baseRequest .setHandled (true );
394- return ;
387+ ByteArrayOutputStream baos = new ByteArrayOutputStream ();
388+ Utils .copy (is , baos );
389+ response .put ("data" , new String (
390+ baos .toByteArray (), StandardCharsets .UTF_8 ));
395391 }
396392
397393 response .put ("args" , mapParametersToJSON (request ));
0 commit comments