[webview_flutter] fix: Fixed handling of null authentication challeng…#8619
[webview_flutter] fix: Fixed handling of null authentication challeng…#8619msamoeed wants to merge 1 commit intoflutter:mainfrom
Conversation
…e responses to follow WKWebView's default behavior, When no authentication challenge handler is implemented in Flutter, return the default WKWebView cancel response instead of throwing an error. This makes the behavior more idiomatic and prevents crashes When no authentication challenge handler is implemented in Flutter, return the default WKWebView cancel response instead of throwing an error. Fixes flutter/flutter#163213
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
|
Closing in favor of #8564, which is already reviewed. In the future, please don't indiscriminately check all the boxes in the checklist; the reason the checklist is there is to make sure all the required steps have been done, and checking the boxes without doing the steps doesn't accomplish that goal:
These were not done.
The PR as submitted does not compile. |
| let details: String? = nilOrValue(listResponse[2]) | ||
| completion(.failure(PigeonError(code: code, message: message, details: details))) | ||
| } else if listResponse[0] == nil { | ||
| } else if listResponse[0] == nil || firstElement is NSNull { |
There was a problem hiding this comment.
Also for reference in case you plan to contribute to webview_flutter in the future: Per the comment at the top of this file, it cannot be edited like this.
// Autogenerated from Pigeon (v22.7.2), do not edit directly.
Description
This PR improves the handling of authentication challenges in WKWebView when no handler is implemented in Flutter. Instead of throwing an error when receiving a null response, it now returns a default cancel response, matching WKWebView's standard behavior.
Changes
didReceiveAuthenticationChallengeto handle null responses gracefullyWhy?
Previously, the code would crash when no authentication challenge handler was implemented in Flutter. This change makes the behavior more idiomatic by following WKWebView's default patterns.
Related Issues
Fixes flutter/flutter#163213
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.mdto add a description of the change, [following repository CHANGELOG style], or this PR is [exempt from CHANGELOG changes].///).