You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While migrating from Express 4 to Express 5, we noticed that our previous call to sendFile('foo.js'); was returning the mime type of "text/javascript" for Express 5 vs the previous Express 4 "application/javascript".
Expectations
While the Express 5 migration document clearly stated the move from 'express.static.mime' to the 'mime-types' package, it didn't elaborate that might have unexpected consequences even for those that were not directly using 'express.static.mime' by other methods such as 'sendFile' that is supported in both Express 4 and 5 can return different content type headers than expected because 'mime-types' is using a different value.
This might only be isolated to 'text/javascript' and 'application/javascript', but a full comparison of the two might yield other type differences that users should be aware of.
Making this more clear in either the mime section or the sendFile section would help migrators.
Thanks.
The text was updated successfully, but these errors were encountered:
Description
While migrating from Express 4 to Express 5, we noticed that our previous call to
sendFile('foo.js');
was returning the mime type of "text/javascript" for Express 5 vs the previous Express 4 "application/javascript".Expectations
While the Express 5 migration document clearly stated the move from 'express.static.mime' to the 'mime-types' package, it didn't elaborate that might have unexpected consequences even for those that were not directly using 'express.static.mime' by other methods such as 'sendFile' that is supported in both Express 4 and 5 can return different content type headers than expected because 'mime-types' is using a different value.
This might only be isolated to 'text/javascript' and 'application/javascript', but a full comparison of the two might yield other type differences that users should be aware of.
Making this more clear in either the mime section or the sendFile section would help migrators.
Thanks.
The text was updated successfully, but these errors were encountered: