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
invalid url causing crash in ios #3384
Comments
@akshgods can you check issue is reproducible on latest version? |
@netmaxt3r yes confirmed with latest available version. code to test:
Environment: OS: Mac |
@netmaxt3r but im getting same error as i sent before. but im not getting warning , can you share your code and url used? also send react native version and plugin version used |
@netmaxt3r i understand you code diffrence you used http:// in starting of url just use this without http:
|
@akshgods i havent added http protocol, it is added by android as the url is malformed it cannot detect the protocol, where as in ios it defaults to return (
<WebView source={{ uri: '3Ca%20_blank%20href=https://reactnative.dev/' }}
style={{ flex: 1 }}
onError={(e) => {
console.log('onError:: ', e.nativeEvent);
}}
onHttpError={(e) => {
console.log('onHttpError:: ', e);
}}
renderError={(e) => {
console.log('renderError:: ', e);
}}
/>
); "dependencies": {
"react": "18.2.0",
"react-native": "0.73.6",
"react-native-webview": "^13.8.5"
} |
Bug description:
If we pass invalid url we are getting crash
actual url: https://www.hindustantimes.com/ht-img/img/2024/03/27/550x309/Akshay_Kumar_1711524357605_1711524357751.jpg
invalid url which causing crash:
'%3Ca%20_blank%20href=https://www.hindustantimes.com/ht-img/img/2024/03/27/550x309/Akshay_Kumar_1711524357605_1711524357751.jpg'
Error handling functions not returning anything.
To Reproduce:
Reproduce is simple, just use this url in your webview url:
url={'%3Ca%20_blank%20href=https://www.hindustantimes.com/ht-img/img/2024/03/27/550x309/Akshay_Kumar_1711524357605_1711524357751.jpg'}
now open webview you will get application getting crash.
Expected behavior:
it should not get crashed , it will throw error in one of error handling function.
let me know what changes required or what we can do it to solved this?
Environment:
The text was updated successfully, but these errors were encountered: