Closed squonk11 closed 3 years ago
Does the filesystem support case? I.e. is image.svg
the same as image.SVG
? If yes, ext
should be transformed to lower-case before the comparisons. If not, I'm happy to merge this.
Shouldn't it be vice versa: if the filesystem does not support case ext
must be transformed to lower-case? Because: if the filesystem does not distinguish case, .SVG
and .svg
must always match the comparison.
Well, depends on if files always are stored in lower case or not? I don't remember what the case is for the fs used in IDF.
On Sun, 10 Jan 2021, 19:52 Lothar, notifications@github.com wrote:
Shouldn't it be vice versa: if the filesystem does not support case ext must be transformed to lower-case? Because: if the filesystem does not distinguish case, .SVG and .svg must always match the comparison.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PerMalmberg/Smooth/pull/140#issuecomment-757524893, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU2LLH77LMRE2NY3C6KWGTSZHZOTANCNFSM4V3UY5SQ .
master of esp-idf has some issues with old-style-cast.
Maybe it is time to rebuild the docker image used in CI, it is a bit dated at this time.
I tested the case sensitivity of the file system and it seems that it is not case-sensitive. Additionally I found this discussion where people also say that it is case-insensitive. That seems to be logical as FAT is a filesystem coming from DOS/Windows where files are always case-insensitive.
But nevertheless if a user uses href="css/style.CSS"
he'd probably expect that this will match the file style.css
. In order to achieve this ext
would need to be converted to lowercase. Unfortunately this has some drawbacks:
for_each(ext.begin(), ext.end(), [](char& in){ in = ::tolower(in); });
const auto&
. So, I would need to make a local copy before comparingShall I do this?
Concerning updating the docker image: unfortunately I am no familiar with Docker. So, it would be quite cumbersome for me to do it...
Please do. Smooth already has a to_lower_copy: https://github.com/PerMalmberg/Smooth/blob/0e277276623a89b7484c8d9205776436ca947502/lib/smooth/include/smooth/core/util/string_util.h#L55
I'll do the Docker update, whenever I get around to it.
Nice 👍
I added some more mime types to 'get_content_type()' in http_utils.cpp. Additionally I added
#pragma GCC diagnostic ignored "-Wold-style-cast"
to some header files because the actual master of esp-idf has some issues with old-style-cast.