# HG changeset patch # User Valentin Bartenev # Date 1375299646 -14400 # Node ID ae3fd1ca62e0942a6c83a37f30df386622462c80 # Parent fa07bec738ac4df2dd571ea1ba31392e2eac2be4 MIME: use "application/javascript" for .js files. Though there are several MIME types commonly used for JavaScript nowadays, the most common being "text/javascript", "application/javascript", and currently used by nginx "application/x-javascript", RFC 4329 prefers "application/javascript". The "charset_types" directive's default value was adjusted accordingly. diff --git a/conf/mime.types b/conf/mime.types --- a/conf/mime.types +++ b/conf/mime.types @@ -5,7 +5,7 @@ types { text/xml xml; image/gif gif; image/jpeg jpeg jpg; - application/x-javascript js; + application/javascript js; application/atom+xml atom; application/rss+xml rss; diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c --- a/src/http/modules/ngx_http_charset_filter_module.c +++ b/src/http/modules/ngx_http_charset_filter_module.c @@ -128,7 +128,7 @@ ngx_str_t ngx_http_charset_default_type ngx_string("text/xml"), ngx_string("text/plain"), ngx_string("text/vnd.wap.wml"), - ngx_string("application/x-javascript"), + ngx_string("application/javascript"), ngx_string("application/rss+xml"), ngx_null_string };