Option to make PhysicalFileProvider case insensitive
See original GitHub issueIs your feature request related to a problem? Please describe.
We currently host our .NET Core services on Windows servers, but would really like to move them to Linux Docker containers some time down the line. However, having the PhysicalFileProvider rely on how the underlying OS treats casing for files and directories puts this as risk as our services currently ignore file and directory casing as they are hosted on Windows, moving them to Linux could potentially break a lot of our applications.
Describe the solution you’d like
While simply doing everything in lower case is an option, I would rather have an option to enable case insensitivity.
Maybe something in the lines on this
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider("some path")
{
UseActivePolling = true,
IgnoreCase = true
}
});
Describe alternatives you’ve considered
As mentioned, while simply deciding to do everything lower case is an option, I would rather be able to ensure that there isn’t any issues like this in our future migration.
Additional context
None
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top GitHub Comments
@rasmus Hi, I have created a middleware which allows ignore case for static files, it might be able to help you. https://github.com/XiaoFaye/CaseInsensitiveStaticFile
Similar/same thing tracked in https://github.com/dotnet/runtime/issues/35128. PhysicalFileProvider is not in this repo anymore.