Open Blackclaws opened 1 year ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I think the issue here is that you have a .
character (not encoded) in the URL. That makes it try to look for a file on disk, because it looks like it has a filename extension. We use this heuristic ("if it has a filename extension, only look for files on disk") because people get confused otherwise if a request for /images/some-file-that-does-not-exist.png
returns some HTML instead of a 404.
If you're using the "ASP.NET Core hosted" approach, you can control this manually by calling MapFallbackToFile
based on whether you pass path:nonfile
as a constraint. For the Blazor WebAssembly dev server, there is unfortunately no config option to override that.
@SteveSandersonMS I get where the idea comes from. You want to directly give feedback to developers that they are missing referenced images or other files.
I think this is something that would be a nice to have if it was added to the dev host. I've now solved this problem for me personally by putting a reverse proxy in front that handles these cases in development.
It would still be nice if the dev host could be configured to not try and resolve files outside of _content, _framework and the appsettings/styles/index files.
I personally don't put anything in the main wwwroot aside from the appsettings and index.html, so all my content lives in _content anyway because its stored in class libraries. But I get that this isn't the general case.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Is there an existing issue for this?
Describe the bug
When using a path parameter, the blazor wasm dev host returns 404 not found when the path parameter is an urlencoded url.
Example:
Create a blazor wasm project which is hosted on port 9443 and navigate to the page:
Expected Behavior
Blazor Wasm application loads and parses the url parameter correctly.
Steps To Reproduce
dotnet new blazorwasm
dotnet run
Exceptions (if any)
No response
.NET Version
7.0.100
Anything else?
Navigating to these urls within the blazor wasm app works as expected. Its just the initial load that isn't correctly supported by the Dev Host.