Skip to content
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

decidePolicyForNavigationResponse doesn't check that response is NSHTTPURLResponse #199

Closed
jordoh opened this issue Sep 26, 2018 · 2 comments

Comments

@jordoh
Copy link

jordoh commented Sep 26, 2018

When loading an HTML page from a bundled file (e.g. source={ { file: ... } }), the navigationResponse.response is not a NSHTTPURLResponse, which results in a SIGABRT when accessing the non-existent allHeaderFields property. This manifests (e.g. via crash reporting) as the following exception:

Application threw exception NSInternalInconsistencyException: Completion handler passed to -[RCTWKWebView webView:decidePolicyForNavigationResponse:decisionHandler:] was not called

image

I've tried passing onNavigationResponse={ null } to work around this, but _onNavigationResponse is still truthy even if I do, so the block in decidePolicyForNavigationResponse is still entered.

I'm happy to submit a PR to handle non-HTTP responses, given some guidance on what the desired handling would be. Should _onNavigationResponse be skipped in those cases, or called with different parameters? CC @DimitryDushkin

@insraq
Copy link
Contributor

insraq commented Oct 8, 2018

Should have been fixed with PR #195

@jordoh
Copy link
Author

jordoh commented Oct 8, 2018

Great, thanks!

@jordoh jordoh closed this as completed Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants