wintercg / proposal-common-minimum-api

https://common-min-api.proposal.wintercg.org/
Other
216 stars 15 forks source link

Spec missing Headers.entries #60

Closed syrusakbary closed 6 months ago

syrusakbary commented 8 months ago

Headers.entries is implemented in some WinterCG runtimes (Deno Deploy & Cloudflare Workers) but is not in the spec. Here's the example:

self.addEventListener('fetch', event => {
  let headers = event.request.headers;
  event.respondWith(new Response(`typeof headers.entries == "${typeof headers.entries}"`));
})

See related issue on WinterJS: https://github.com/wasmerio/winterjs/issues/25#issuecomment-1790851061

Should entries be added to the spec so Cloudflare and Deno Deploy stay compliant with the spec and the rest of runtimes add support as well?

jasnell commented 7 months ago

headers.entries is actually defined as a side of effect of the Headers object being defined as an iterable (https://webidl.spec.whatwg.org/#idl-iterable) so this is technically covered by the spec already... runtimes that support headers.entries (workerd, deno, node.js, etc) already compliant.