diff --git a/src/android/com/ionicframework/cordova/webview/WebViewLocalServer.java b/src/android/com/ionicframework/cordova/webview/WebViewLocalServer.java index cf134932..1bb27604 100644 --- a/src/android/com/ionicframework/cordova/webview/WebViewLocalServer.java +++ b/src/android/com/ionicframework/cordova/webview/WebViewLocalServer.java @@ -193,7 +193,7 @@ private static WebResourceResponse createWebResourceResponse(String mimeType, St if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { int finalStatusCode = statusCode; try { - if (data.available() == 0) { + if (data.available() == -1) { finalStatusCode = 404; } } catch (IOException e) { @@ -595,7 +595,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