-
Notifications
You must be signed in to change notification settings - Fork 26
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
Overwriting the headers instead of creating new custom syntax #107
Comments
There’s no such thing as a header in ecma-262, or in non-browsers (for non-http imports, that is) |
I would note that assertions do not allow alteration or overriding of the headers, they are merely an integrity check. Changing headers would go to a separate evaluators proposal : https://github.com/tc39/proposal-import-assertions#follow-up-proposal-evaluator-attributes |
@franciscop is that a satisfying answer to you? we discussed that in the past. Can I close the issue? |
I think this proposal is a bit too low-level: it's more verbose and feels less likely to work the same across environments. |
Oh sorry I missed that from the proposal, then yes this is fine! |
Sorry for being late to the party. My proposal is to, instead of creating a new way of naming a header, overwrite the
Content-Type
server-side header through this syntax:Why?
type
is an HTML attribute and not even the right one because ofasserttype
,assert
is normally used for testing)Content-Type
, while in the current proposal just by looking at the statement it's not clear if it's doing content-negotiation (Accepts
) or resolution as intended (Content-Type
).with
in a new context instead of creating a new keyword.types
that require nesting likenew Worker('my-app.wasm', { type: 'module', assert: { type: 'webassembly' } })
(by usingnew Worker('my-app.wasm', { type: 'module', Content-Type: 'webassembly' })
This might seem similar as issue #85, but this issue is about overwriting the response headers, not about content type negotiation.
The text was updated successfully, but these errors were encountered: