Skip to content

Commit

Permalink
fix(webserver): discard file upload in case of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Jan 8, 2025
1 parent eae410a commit b95e780
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ public HttpResponse<Void> importFlows(
}
}
} else {
fileUpload.discard();
throw new IllegalArgumentException("Cannot import file of type " + fileName.substring(fileName.lastIndexOf('.')));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ public HttpResponse<Void> importTemplates(@Parameter(description = "The file to
}
}
} else {
fileUpload.discard();
throw new IllegalArgumentException("Cannot import file of type " + fileName.substring(fileName.lastIndexOf('.')));
}

Expand Down

0 comments on commit b95e780

Please sign in to comment.