diff --git a/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java b/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java index 43f965b46..d632065a9 100755 --- a/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java +++ b/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java @@ -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) { @@ -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