From 75b78c0e55f2718ff2e70a7e6517a83bcf895149 Mon Sep 17 00:00:00 2001 From: tommasini Date: Fri, 6 Sep 2024 16:50:38 +0100 Subject: [PATCH] fix --- apple/RNCWebViewImpl.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apple/RNCWebViewImpl.m b/apple/RNCWebViewImpl.m index c274399db..6a58db34c 100644 --- a/apple/RNCWebViewImpl.m +++ b/apple/RNCWebViewImpl.m @@ -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 *httpErrorEvent = [self baseEvent]; [httpErrorEvent addEntriesFromDictionary: @{ @"url": response.URL.absoluteString,