PerMalmberg / Smooth

C++ framework for embedded programming on top of Espressif's ESP-IDF.
Apache License 2.0
325 stars 30 forks source link

added some more mime types to 'get_content_type()' in http_utils.cpp #140

Closed squonk11 closed 3 years ago

squonk11 commented 3 years ago

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.

PerMalmberg commented 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.

squonk11 commented 3 years ago

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.

PerMalmberg commented 3 years ago

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 .

PerMalmberg commented 3 years ago

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.

squonk11 commented 3 years ago

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:

Shall 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...

PerMalmberg commented 3 years ago

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.

PerMalmberg commented 3 years ago

Nice 👍