Skip to content

Commit

Permalink
Merge pull request #38 from MetaMask/fix/webview-ios-issue
Browse files Browse the repository at this point in the history
fix webvios ios
  • Loading branch information
tommasini authored Sep 10, 2024
2 parents a7e2ea6 + 75b78c0 commit a1b4f8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apple/RNCWebViewImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -1356,12 +1356,12 @@ - (void) webView:(WKWebView *)webView
decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler
{
WKNavigationResponsePolicy policy = WKNavigationResponsePolicyAllow;
if (_onHttpError && navigationResponse.forMainFrame) {
if (_onHttpError) {
if ([navigationResponse.response isKindOfClass:[NSHTTPURLResponse class]]) {
NSHTTPURLResponse *response = (NSHTTPURLResponse *)navigationResponse.response;
NSInteger statusCode = response.statusCode;

if (statusCode >= 400) {
if (statusCode >= 400 && navigationResponse.forMainFrame) {
NSMutableDictionary<NSString *, id> *httpErrorEvent = [self baseEvent];
[httpErrorEvent addEntriesFromDictionary: @{
@"url": response.URL.absoluteString,
Expand Down

0 comments on commit a1b4f8c

Please sign in to comment.