Skip to content

Commit

Permalink
Merge pull request #58 from kan-izh/master
Browse files Browse the repository at this point in the history
Accept success codes only while uploading to http
  • Loading branch information
axdotl authored Sep 2, 2019
2 parents 75707a1 + 47f0135 commit 22b1073
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void uploadSingle(String file) throws IOException, BadUploadException, M
try (FileInputStream fileInputStream = new FileInputStream(fileToUpload)) {
IOUtils.copy(fileInputStream, connection.getOutputStream());
}
if (connection.getResponseCode() >= 400) {
if (connection.getResponseCode() >= 300) {
String response = IOUtils.toString(connection.getErrorStream(), Charset.defaultCharset());
throw new BadUploadException(response);
} else {
Expand Down

0 comments on commit 22b1073

Please sign in to comment.