Skip to content

Commit a423019

Browse files
committed
test(headers): check that pseudo-headers are allowed
1 parent 6e0c9d5 commit a423019

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/fetch/test/headers.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,19 @@ describe('Headers', () => {
216216
expect(() => headers.append('', 'ok')).to.throw(TypeError);
217217
});
218218

219+
it('should allow HTTP2 pseudo-headers', () => {
220+
let headers = new Headers({':authority': 'something'});
221+
headers.append(":method", "something else")
222+
223+
const result = [];
224+
for (const pair of headers) {
225+
result.push(pair);
226+
}
227+
228+
expect(result).to.deep.equal([[':authority', 'something'], [':method', 'something else']]);
229+
230+
})
231+
219232
it('should ignore unsupported attributes while reading headers', () => {
220233
const FakeHeader = function () { };
221234
// Prototypes are currently ignored

0 commit comments

Comments
 (0)