-
Notifications
You must be signed in to change notification settings - Fork 54
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
Missing Headers.entries
#25
Comments
According to https://fetch.spec.whatwg.org/#headers, the headers object itself should be iterable. There is no The Headers.prototype.entries = function() {
return this[Symbol.iterator]();
} We're discussing internally how we might support non-standard APIs (the standard in question being WinterCG). |
I've checked in Deno Deploy and Cloudflare Workers with this script: self.addEventListener('fetch', event => {
let headers = event.request.headers;
event.respondWith(new Response(`typeof headers.entries == "${typeof headers.entries}"`));
}) In both cases, the response was:
Which means that both Cloudflare Workers and Deno Deploy had this implemented. We should follow up to see if it should be in the spec |
We made the decision to follow Cloudflare Workers, and implement |
I've added the method in, will be available with the next version. |
Thanks! |
(context: from nitrojs/nitro#1861 tracker)
Tested runtime version: v0.1.7
MDN docs: https://developer.mozilla.org/en-US/docs/Web/API/Headers/entries
Headers.entries
method seems missing.The text was updated successfully, but these errors were encountered: