For extension ".js" mime type is supposed to be "application/javascript" but lwan_determine_mime_type_for_file_name function returns "application/octet-stream".
The enum value of EXT_JS is 0x00736a2e but switch statement evaluates to 0x20736a2e.
This is expected as we are doing bitwise OR with 0x20202020.
To fix we can change EXT_JS to 0x20736a2e.
I am attaching unit test which fails for current code and passes after proposed change.
test_mime_type.c.txt
This was working purely by chance before, since the slow path using bsearch() used to include the MIME type for JavaScript files. Thanks for noticing this. Should be fixed now.
For extension ".js" mime type is supposed to be "application/javascript" but lwan_determine_mime_type_for_file_name function returns "application/octet-stream". The enum value of EXT_JS is 0x00736a2e but switch statement evaluates to 0x20736a2e. This is expected as we are doing bitwise OR with 0x20202020. To fix we can change EXT_JS to 0x20736a2e. I am attaching unit test which fails for current code and passes after proposed change. test_mime_type.c.txt