-
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] Encoding webview's source #24002
base: main
Are you sure you want to change the base?
Conversation
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
This just fixes the spaces, there is another issue for square brackets. Should we just use the UriEncode method to catch it all? |
@jfversluis |
Oh yeah that makes sense. Hmmm I do wonder why this worked in Xamarin.Forms though and not here. Same with #23690 |
@jfversluis
|
@@ -48,7 +48,8 @@ void LoadUrl(string url, bool fireNavigatingCanceled) | |||
if (!fireNavigatingCanceled || !SendNavigatingCanceled(url)) | |||
{ | |||
_eventState = WebNavigationEvent.NewPage; | |||
if (url != null && !url.StartsWith('/') && !Uri.IsWellFormedUriString(url, UriKind.Absolute)) | |||
string? spacesEscapedUrl = url?.Replace(" ","%20", StringComparison.InvariantCulture); |
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.
Is there no Uri.EncodeSomething that is safer? What about other "special" characters in the uri?
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.
That is a bit problematic: #24002 (comment)
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.
Can we only encode whatever comes after the base URL? So only the query string basically?
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.
Imo, great idea!
Co-Authored-By: Gerald Versluis <gerald.versluis@microsoft.com>
Any progress on this? Not sure if I have same problem since a single bracket or space works fine when escaped. HOWEVER using a space AND a german special character creates error shown above. See sample code:
|
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Issues Fixed
Fixes #23767
Fixes #23690
Screen.Recording.2024-08-04.at.14.06.51.mov
Screen.Recording.2024-08-04.at.14.04.00.mov