Skip to content

Commit 3f74300

Browse files
committed
Fixes iOS issue where onPageError gets called for status codes < 400
1 parent 6c22f25 commit 3f74300

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,8 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate {
617617
},
618618
decidePolicyForNavigationResponse:
619619
(WKWebView webView, WKNavigationResponse response) async {
620-
if (weakThis.target?._onPageError != null) {
620+
if (weakThis.target?._onPageError != null &&
621+
response.response.statusCode >= 400) {
621622
weakThis.target!._onPageError!(response.response.statusCode);
622623
}
623624

0 commit comments

Comments
 (0)