-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(WebViewLocalServer.java): return 404 error code when a local file is not found #217
feat(WebViewLocalServer.java): return 404 error code when a local file is not found #217
Conversation
…e is not found Currently, the Android version of the plugin always returns http code 200 no matter if the resource you're trying to get exists or not. The iOS version does. This makes the two implementations inconsistent. This tries to fix that and use the same expected behavior in both of them. BREAKING CHANGE: Until now, the Android part of the plugin was returning a 200 http code even though the requested file didn't exist. This behavior was inconsistent with the historical behavior of the iOS webView. This change makes them both work in the same manner but introduces a breaking change for the current Android users that are expecting a 200 http code no matter what and are testing the not found error just by checking if the body is null. fix ionic-team#216
Thanks for the PR. Any implications of this that we should be aware of? Are you using Ionic 4 with HTML5 routing by chance? |
You're welcome! Regarding the implications, none that I'm aware of apart from the breaking change I described above. Unfortunately, I'm not using Ionic 4 so I haven't been able to check if there were some unexpected side-effects. The way I see it is that the iOS version is already working like that, so my guess is that we may not expect any further implications. |
Thanks for the PR. |
You're very welcome! Do you have any idea of what will be the estimated release date? |
There is no release date, but shouldn't take long. |
# [3.0.0](v2.3.1...v3.0.0) (2019-01-03) ### Bug Fixes * **iOS:** Remove unused code ([#247](#247)) ([bceb17a](bceb17a)) ### Features * Allows configuration of Mixed Content Mode ([#240](#240)) ([486d412](486d412)), closes [#231](#231) * **Android:** Implement ionic-file and ionic-content urls ([#242](#242)) ([8ef0c30](8ef0c30)), closes [#204](#204) [#183](#183) * **iOS:** Remove GCDWebServer ([#244](#244)) ([0dee0cf](0dee0cf)) * **WebViewLocalServer.java:** return 404 error code when a local file is not found ([#217](#217)) ([f7a551e](f7a551e)), closes [#216](#216) ### BREAKING CHANGES * **iOS:** Sets deployment-target to 11, so will only work on iOS 11+ * Address changes * changes the default from 1 (never) to 0 (always) * **WebViewLocalServer.java:** Until now, the Android part of the plugin was returning a 200 http code even though the requested file didn't exist. This behavior was inconsistent with the historical behavior of the iOS webView. This change makes them both work in the same manner but introduces a breaking change for the current Android users that are expecting a 200 http code no matter what and are testing the not found error just by checking if the body is null.
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Currently, the Android version of the plugin always returns http code 200 no matter if the resource
you're trying to get exists or not. The iOS version does return a specific http code for every case. This makes the two implementations inconsistent. This tries to fix that and get the same expected behavior in both of them.
Note that I've used a 500 code in case the call to the
available
method fails. If this is not right let me know and I'll change it. 😉BREAKING CHANGE: Until now, the Android part of the plugin was returning a 200 http code even though
the requested file didn't exist. This behavior was inconsistent with the historical behavior of the
iOS webView. This change makes them both work in the same manner but introduces a breaking change
for the current Android users that are expecting a 200 http code no matter what and are testing the
not found error just by checking if the body is null.
fix #216