Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1407 closed defect (invalid)

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

Reported by: henrik.gemal.dk@… 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

Description

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, 7 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@…, 7 years ago

Why do you think so?

See https://tools.ietf.org/html/draft-ietf-dispatch-javascript-mjs-00#section-4.2

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 https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:

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.