GET Accept: text/javascript
snuggs opened this issue ยท 1 comments
PRs & Issues
(New) Specification
@brandondees we'll need to update Koa, (at minimum), Rails, Sinatra, Express, for the new .mjs
and existing .es
extensions. Many servers respond with application/octetstream
for .mjs
and .es
. This is problematic and causes a Content-Disposition
due to the spec stating to NEVER run that media type (for obvious security reasons). Luckily we can just update the core libs for respective platforms and cure most of the (sane) frameworks in the meantime. Anything that prevents the downloading of these files.
This prevents people from linking to unpkg
. As a band aid we create a .es.js
file ๐ฉ
For example >>> http://unpkg.com/snuggsi/dist/snuggsi.min.es vs http://unpkg.com/snuggsi/dist/snuggsi.min.es.js
Same holds true for .mjs
files. Therefore a TON of servers are "broken" with this feature/bug (including ourselves).
I'm on it this weekend. This list and Resource.assets
will be just about it for this PR. https://snuggsi.es
can be active then and unpkg.com will work properly for people migrating to JS modules which will be very shortly here. Lastly, web/WHATWG/W3C/IETF/HTML/Fetch/DOM specs are fairly in order as media types have been an ancient ๐ฉ show for about a decade now.
@tmornini may need your guidance on the protocol to update golang source code. text/x-javascript
is on the MUST NOT USE list as far as the platform is concerned. What should we do to notify them? https://golang.org/src/mime/type.go
Related
- Submit proposal for
.mjs
to IETF - Un-deprecate
text/javascript
Media type - Update
application/ecmascript
to respect.mjs
extension - Update to reflect
application/ecmascript
- Add
.mjs
to mime types database for defaulttext/javascript
- Update Rails Media Type extensions
.mjs
,.es
- Update Sinatra (Probably in Rack Contrib) Media Type extensions
.mjs
,.es
- Add
.mjs
to mime types database with rest of the following WHATWG approved Media Types - ๐ bump
mime-types
https://github.com/jshttp/mime-types/blob/master/package.json#L17 - ๐ bump
node-mime
broofa/mime@f60fbe2 - ๐ bump
type-is
https://github.com/jshttp/type-is/blob/master/package.json#L13 - ๐ bump
accepts
https://github.com/jshttp/accepts/blob/master/package.json#L12 - ๐ bump
compressible
https://github.com/jshttp/compressible/blob/master/package.json#L19 - ๐ bump
koa
https://github.com/koajs/koa/blob/master/package.json#L42 - ๐ bump
express
(viatype-is
library) https://github.com/expressjs/express/blob/master/package.json#L57 - ๐ Bump send https://github.com/pillarjs/send/blob/master/index.js#L24
@brandondees @tmornini @btakita @kurtcagle we have a proposed spec from ietf now and gives the green light to update these packages.
P.S. Breaking changes to servers as 90% of them respond incorrectly with application/javascript
....The conclusion was made that there is either text or binary (application) code. Nothing else.
There WILL be blood. Quite possibly a Pyrrhic Victory
But what do you do when the web has been mis-speced forever? ยฏ_(ใ)_/ยฏ