react-native-pinch
react-native-pinch copied to clipboard
Unsafe cast causing a crash on Android when an http URL is erroneously used
In android HTTPUtil.java:
HttpsURLConnection connection; URL url = new URL(request.endpoint); String method = request.method.toUpperCase(); line 81: connection = (HttpsURLConnection) url.openConnection();
If the request.endpoint is erroneously http, url.Connection() will return an HttpURLConnection object. The forced cast will cause a runtime exception/crash.
Ideally the code should check for the URL prefix before doing a cast.