Skip to content

Commit

Permalink
test(headers): check that pseudo-headers are allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Dec 5, 2023
1 parent 6e0c9d5 commit a423019
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/fetch/test/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a423019

Please sign in to comment.