File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
workspace-server/src/main/java/gov/nasa/jpl/aerie/workspace/server Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -697,12 +697,13 @@ public void bulkPut(Context context) throws NoSuchWorkspaceException {
697697 }""" ;
698698
699699 // Get body
700- if (!context .isMultipartFormData ()) {
700+ if (!context .isMultipartFormData () || context . formParam ( "body" ) == null ) {
701701 context .status (400 ).json (new FormattedError ("Invalid body format." ,
702702 """
703703 Expected body format is a multipart/form with two fields:
704704 "body", which contains the list of JSON objects describing where to put each file and directory
705705 "files", which contains all uploaded file contents""" ));
706+ return ;
706707 }
707708 try (final var bodyReader = Json .createReader (new StringReader (context .formParam ("body" )))){
708709 toUpload = bodyReader .readArray ().getValuesAs (obj -> BulkPutItem .fromJson (obj .asJsonObject ()));
@@ -711,11 +712,6 @@ public void bulkPut(Context context) throws NoSuchWorkspaceException {
711712 je ,
712713 "Invalid body format. Expected body format is an array of JSON objects with the form:\n \n " +helpText ));
713714 return ;
714- } catch (NullPointerException ne ) {
715- context .status (400 ).json (new FormattedError (
716- ne ,
717- "Invalid body format. Expected body format is an array of JSON objects with the form:\n \n " +helpText ));
718- return ;
719715 }
720716
721717 // Ensure that the user has specified at least one file or directory to upload
You can’t perform that action at this time.
0 commit comments