From a423019b6922ecdb0c5e521d7b2a95a38ec66902 Mon Sep 17 00:00:00 2001 From: Pedro Cattori Date: Tue, 5 Dec 2023 17:30:47 -0500 Subject: [PATCH] test(headers): check that pseudo-headers are allowed --- packages/fetch/test/headers.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/fetch/test/headers.js b/packages/fetch/test/headers.js index 94354cc..8f9e168 100644 --- a/packages/fetch/test/headers.js +++ b/packages/fetch/test/headers.js @@ -216,6 +216,19 @@ describe('Headers', () => { expect(() => headers.append('', 'ok')).to.throw(TypeError); }); + it('should allow HTTP2 pseudo-headers', () => { + let headers = new Headers({':authority': 'something'}); + headers.append(":method", "something else") + + const result = []; + for (const pair of headers) { + result.push(pair); + } + + expect(result).to.deep.equal([[':authority', 'something'], [':method', 'something else']]); + + }) + it('should ignore unsupported attributes while reading headers', () => { const FakeHeader = function () { }; // Prototypes are currently ignored