-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresfeature-static-files
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
app.UseStaticFiles() returns 404 for file names that contain spaces and the browser requests them using + rather than %20.
Such links are easy to come across since HttpUtility.UrlEncode uses + to encode spaces. HttpUtility.UrlPathEncode which encodes spaces as %20 is documented as do not use.
Expected Behavior
The + sign to be decoded into space and the files served.
Steps To Reproduce
- Create a new ASP.NET project
- Put a file with space in the wwwroot folder.
- Request it using
+for space.
Exceptions (if any)
No response
.NET Version
10.0.100-rc.2.25502.107
Anything else?
Running on Microsoft.AspNetCore.App 8.0.21.
Metadata
Metadata
Assignees
Labels
area-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresfeature-static-files