loader icon indicating copy to clipboard operation
loader copied to clipboard

Accept header

Open guybedford opened this issue 10 years ago • 5 comments

Just to bring up the question - is it worth altering the accept header for ES6 module file requests?

guybedford avatar Mar 03 '15 18:03 guybedford

We have been looking for a fallback mechanism, maybe extending the accept header, or any other request header is the solution. By doing that, we should be able to do something like this:

<script src="path/to/foo.js" type="module"></script>

...where the fallback mechanism can be implemented on the edge layer by analyzing the headers, and providing the right format.

updated

caridy avatar Mar 03 '15 18:03 caridy

@caridy what does that have to do with the question of accept headers, can you explain?

matthewp avatar Mar 10 '15 19:03 matthewp

@matthewp imagine a service that analyzes the header, and infers whether or not the browser supports modules, and based on that it responses with a module or a transpiled version of it. This is not as crazy as it sounds :)

caridy avatar Mar 10 '15 21:03 caridy

What would be different about the headers? Isn't that @guybedford's question, if the Accept header should be different for modules?

matthewp avatar Mar 10 '15 21:03 matthewp

Ah, @matthewp, I finally see what you mean, let me rephrase it in my first comment...

caridy avatar Mar 10 '15 23:03 caridy