Re: [whatwg/fetch] Is a missing HeadersInit treated differently from an empty one? (#479)

Having been asked to weigh in, here are my weak preferences:

- I sympathize with `{}` meaning explicit "the list is empty". Let's keep that. So `{ headers: {} }` means an empty headers list.
- I think `undefined` for *any* dictionary member should be equivalent to the member not being present. So `{ headers: undefined }` should be the same as `{ }` (which I believe means "copy the input"?)
- In general I think it probably makes sense for `null` and `undefined` to not be convertible to records. So `{ headers: null }` should be an error. `{ headers: undefined }` is not an error per above, since it's a dictionary member, but if we had a function `doStuffWithHeaders(record<DOMString, DOMString> headers)` then IMO `doStuffWithHeaders(undefined)` or `doStuffWith()` should throw.

I don't think we need a new extended attribute for any of this.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/479#issuecomment-278120112

Received on Tuesday, 7 February 2017 19:53:24 UTC