Commit 40bf5e8
authored
Improve JS MIME type detection
Enhances the `_setContentTypeFromPath` method in `AsyncFileResponse` to better handle JavaScript MIME types.
Previously, `.js` files were correctly recognized, but `.mjs` files (ES modules) were not and defaulted to `application/javascript`. This enhancement ensures both `.js` and `.mjs` files are assigned `text/javascript`, improving compatibility with modern browsers.
All other MIME type handling remains unchanged. This change enhances robustness and standards compliance of the file server.
Fix the issue #2671 parent 879d57c commit 40bf5e8
2 files changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | | - | |
643 | | - | |
| 642 | + | |
| 643 | + | |
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
0 commit comments