Skip to content

Commit

Permalink
http: add .mjs extension to default mime types
Browse files Browse the repository at this point in the history
Associate file extension `.mjs` with `application/javascript`.

Context: common output of static site generators. There's little risk of
ambiguity for this extension, so might as well support it out of the
box.

[ Subject tweak - Andrew ]
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
  • Loading branch information
kedartal authored and ac000 committed Jan 14, 2025
1 parent d0dbba3 commit ed12d8a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/nxt_http_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ nxt_http_static_mtypes_init(nxt_mp_t *mp, nxt_lvlhsh_t *hash)
{ nxt_string("text/x-rst"), ".rst" },

{ nxt_string("application/javascript"), ".js" },
{ nxt_string("application/javascript"), ".mjs" },
{ nxt_string("application/json"), ".json" },
{ nxt_string("application/xml"), ".xml" },
{ nxt_string("application/rss+xml"), ".rss" },
Expand Down

0 comments on commit ed12d8a

Please sign in to comment.