Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#1407 closed defect (invalid)

Should application/javascript be text/javascript in mime.types

Reported by:… Owned by:
Priority: minor Milestone:
Component: other Version: 1.13.x
Keywords: Cc:
uname -a: Linux ip
nginx -V: nginx version: nginx/1.12.1


I think the 'content-type' header for js files should have media type 'text/javascript' (not 'application/javascript')

nginx version: nginx/1.12.1

Change History (2)

comment:1 by Valentin V. Bartenev, 5 years ago

Resolution: invalid
Status: newclosed

Why do you think so?

According to RFC 4329 (April 2006):

Use of the "text" top-level type for this kind of content is known to
be problematic. This document thus defines text/javascript and text/
ecmascript but marks them as "obsolete". Use of experimental and
unregistered media types, as listed in part above, is discouraged.
The media types,

  • application/javascript
  • application/ecmascript

which are also defined in this document, are intended for common use
and should be used instead.

comment:2 by sideshowbarker@…, 5 years ago

Why do you think so?


This document proposes updates to the ECMAScript media types,
superseding the existing registrations for "application/javascript"
and "text/javascript"

In particular see:

And see also

Servers should use text/javascript for JavaScript resources. Servers should not use other JavaScript MIME types for JavaScript resources, and must not use non-JavaScript MIME types.

Note: See TracTickets for help on using tickets.