summaryrefslogtreecommitdiff
path: root/src/mod_deflate.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2022-05-26 01:32:23 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2022-05-26 01:34:38 -0400
commit33f73b4d821a3cd09614533d592f102166963cc5 (patch)
treefff206ecdc6435877e40948d45fada69ea4663ee /src/mod_deflate.c
parenta6d4a98c07f68aa8a41965daffd2cd78fb7737fd (diff)
downloadlighttpd-git-33f73b4d821a3cd09614533d592f102166963cc5.tar.gz
[multiple] application/javascript text/javascript
translate MIME type "application/javascript" to "text/javascript" (if required, type may still be overwritten by mod_setenv or mod_magnet) x-ref: "Updates to ECMAScript Media Types" https://www.rfc-editor.org/rfc/rfc9239
Diffstat (limited to 'src/mod_deflate.c')
-rw-r--r--src/mod_deflate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mod_deflate.c b/src/mod_deflate.c
index c55d4a98..64120eb9 100644
--- a/src/mod_deflate.c
+++ b/src/mod_deflate.c
@@ -751,6 +751,9 @@ SETDEFAULTS_FUNC(mod_deflate_set_defaults) {
size_t len = buffer_clen(mimetype);
if (len > 2 && mimetype->ptr[len-1] == '*')
buffer_truncate(mimetype, len-1);
+ if (buffer_eq_slen(mimetype,
+ CONST_STR_LEN("application/javascript")))
+ buffer_copy_string_len(mimetype, "text/javascript", 15);
}
if (0 == cpv->v.a->used) cpv->v.a = NULL;
break;