service-workers icon indicating copy to clipboard operation
service-workers copied to clipboard

Headers append & entries are incompatible

Open jamesarosen opened this issue 4 years ago • 0 comments

What happens

headers.append('foo', 'A')
headers.append('foo', 'B')
headers.entries() // [ ['foo', 'A,B' ] ]

What I expect

headers.append('foo', 'A')
headers.append('foo', 'B')
headers.entries() // [ ['foo', 'A' ], ['foo', 'B' ] ]

This is particularly problematic for Set-Cookie, which is always multiple independent headers, not a single comma-separated header. (And the values often include commas.)

jamesarosen avatar Apr 14 '20 21:04 jamesarosen