Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET Accept: text/javascript #174

Closed
16 tasks done
snuggs opened this issue Jun 8, 2018 · 1 comment
Closed
16 tasks done

GET Accept: text/javascript #174

snuggs opened this issue Jun 8, 2018 · 1 comment

Comments

@snuggs
Copy link
Member

snuggs commented Jun 8, 2018

PRs & Issues

(New) Specification

In defense of .js

@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

@snuggs snuggs changed the title GET Accept: text/html GET Accept: text/javascript Jun 9, 2018
@snuggs
Copy link
Member Author

snuggs commented Jun 9, 2018

@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? ¯_(ツ)_/¯

@snuggs snuggs closed this as completed Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant