Skip to content

Commit

Permalink
fix(android): don't return 404 on empty files (#3323)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Jul 23, 2020
1 parent 2c9b5e1 commit cfbd1e3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ private String getMimeType(String path, InputStream stream) {
private int getStatusCode(InputStream stream, int defaultCode) {
int finalStatusCode = defaultCode;
try {
if (stream.available() == 0) {
if (stream.available() == -1) {
finalStatusCode = 404;
}
} catch (IOException e) {
Expand Down Expand Up @@ -492,7 +492,7 @@ private InputStream getInputStream() {
@Override
public int available() throws IOException {
InputStream is = getInputStream();
return (is != null) ? is.available() : 0;
return (is != null) ? is.available() : -1;
}

@Override
Expand Down

0 comments on commit cfbd1e3

Please sign in to comment.