svenstaro / miniserve

🌟 For when you really just want to serve some files over HTTP right now!
MIT License
5.95k stars 289 forks source link

Feature Request: Case folding #1445

Open Quackdoc opened 1 month ago

Quackdoc commented 1 month ago

It would be nice if miniserve supported casefolding itself, if you try do deploy something that was developed on windows, filenames will often break due to case sensitivity

svenstaro commented 1 month ago

Let's be sure that I know what you mean: You request a file hello.omg at http://localhost:8000/heLLo.omg and with case-folding turned on, it would still serve it?

Quackdoc commented 1 month ago

Correct. This is fairly common if you have a server on a Windows host and try to migrate it to a Linux host. There are some file systems on linux which do support case folding, which does fix the issue, but not all file systems supported.

svenstaro commented 1 month ago

What would the interaction be on a case-sensitive filesystem with this option turned on? If there's a dir with Hello.omg and hellO.omg, which one would be used? Do you know of any webserver that does this so we can look at some prior art?

Quackdoc commented 1 month ago

I'm not sure if there are webservers that do this, and which one it chooses may entirely be up to miniserve to figure out (possibly even with a flag that swaps between lower first or upper first?) as for "prior art" the closest example I have is this python script which starts the http.server with case insensitivity.

case.txt