dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.71k forks source link

Square brackets in WebView URL Sources result in ERR_FILE_NOT_FOUND on Android #23690

Open orecros opened 1 month ago

orecros commented 1 month ago

Description

I'm using a WebView like this

<WebView Source="{Binding Url}"/>
viewModel.Url = "https://google.com/[]"

and on android it shows an ERR_FILE_NOT_FOUND message.

I'm not sure if this needs to be fixed. a little googling https://stackoverflow.com/questions/40568/are-square-brackets-permitted-in-urls shows support for square brackets in URLs is mixed. and there's a simple workaround. This is a regression from xamarin however. I ran into this issue working with stripe, so it's likely others will as well.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

9.0.0-preview.6.24327.7

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android

Did you find any workaround?

Replace the square brackets with their percentage encodings

viewModel.Url = "https://google.com/[]".Replace("[", "%5B").Replace("]", "%5D");

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

mattleibow commented 1 month ago

Not sure this is standard urls, but I will add it to the backlog for investigation.