[nxt_http_static] add .mjs extension to default_types#1541
[nxt_http_static] add .mjs extension to default_types#1541ac000 merged 1 commit intonginx:masterfrom
.mjs extension to default_types#1541Conversation
|
I'm in two minds about this. There are several other obvious missing entries... But then you can always add your own (and modify existing ones) like "settings": {
"http": {
"static": {
"mime_types": {
"application/javascript": [
".js",
".mjs"
]
}
}
}
},Each mime_types entry can either be an array or a string. |
|
@ac000 Of course, but that requires a call to the control API -- in practice, often a separate call from the one for configuring listeners, applications, routes et cetera. IMHO we should add all or most of the standard types: the impacts on the binary size and runtime complexity are negligible, standard MIME changes very slowly so little maintenance cost, and obviously it's easier for users so good for adoption. As you said, users can always append / replace, so including all or most types by default seems natural. |
|
I'm not against adding it... let's see what others think... Cc: @hongzhidao |
|
Hi, |
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>
|
Thanks Tal, applied (with a minor tweak to the commit subject). |
|
@ac000 Thanks! |
Associate file extension
.mjswithapplication/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.