Unescape relative path before file lookup to fix space-in-filename issue
Summary
When serving files, if the requested path contains spaces or other special characters, the lookup fails because Uri.MakeRelativeUri returns a URL-encoded path (e.g. spaces become %20). The file provider expects a plain file path, not a URL-encoded one.
This PR adds a call to Uri.UnescapeDataString after MakeRelativeUri, ensuring the relative path is correctly unescaped before being used to retrieve files.
Thanks for your PR, @@jacob-l. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.
@jacob-l thank you for your contribution. Could you, please add a test in https://github.com/dotnet/aspnetcore/blob/main/src/Components/WebView/WebView/test/StaticContentProviderTests.cs that would demonstrate the encoding failure you're describing?
@dotnet-policy-service agree
Thanks for your feedback and approval, @ilonatommy
We also need security review, as unescaping has security implications.
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.