-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Android] Fix for WebView Fails to Load URLs with Certain Encoded Characters #27003
base: main
Are you sure you want to change the base?
[Android] Fix for WebView Fails to Load URLs with Certain Encoded Characters #27003
Conversation
@dotnet-policy-service agree company="Syncfusion, Inc." |
/azp run |
This comment was marked as outdated.
This comment was marked as outdated.
/azp run |
This comment was marked as outdated.
This comment was marked as outdated.
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build error
/Users/builder/azdo/_work/3/s/src/Core/src/Platform/WebViewHelper.cs(9,32): error CS1503: Argument 1: cannot convert from 'char' to 'string' [/Users/builder/azdo/_work/3/s/src/Core/src/Core.csproj::TargetFramework=netstandard2.0]
IMHO we hit #27003 (comment) |
Root Cause
The root cause of the issue is the use of
Uri.IsWellFormedUriString
for validating URLs in the WebView control. This method applies overly strict checks, including theIsWellFormedOriginalString
test, which can incorrectly reject valid URLs, especially those containing encoded characters or international characters. This leads to improper handling of certain valid URLs, causing them to be treated as relative paths instead of absolute URLs.Description of Change
In the WebView control, the URL validation logic in
MauiWebView.LoadUrl
has been updated to replaceUri.IsWellFormedUriString
withUri.TryCreate
. This change ensures that a wider range of valid URLs, including those with encoded and international characters, are correctly handled as absolute URLs.Issues Fixed
Fixes #26843
Fixes #23767
Fixes #23690
Closes #24002
Tested the behaviour in the following platforms
Screenshots