forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support headers that use `NGHTTP2_NV_FLAG_NO_INDEX` to avoid being indexed by the HTTP2 header compression.
- Loading branch information
Showing
7 changed files
with
105 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Flags: --expose-http2 | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
if (!common.hasCrypto) | ||
common.skip('missing crypto'); | ||
const assert = require('assert'); | ||
const http2 = require('http2'); | ||
|
||
const server = http2.createServer(); | ||
|
||
const src = { | ||
'regular-header': 'foo', | ||
[http2.noStore]: { | ||
'unindexed-header': 'A'.repeat(1000) | ||
} | ||
This comment has been minimized.
Sorry, something went wrong. |
||
}; | ||
|
||
function checkHeaders(headers) { | ||
assert.strictEqual(headers['regular-header'], 'foo'); | ||
assert.strictEqual(headers['unindexed-header'], 'A'.repeat(1000)); | ||
} | ||
|
||
server.on('stream', common.mustCall((stream, headers) => { | ||
checkHeaders(headers); | ||
stream.respond(src); | ||
stream.end(); | ||
})); | ||
|
||
server.listen(0, common.mustCall(() => { | ||
const client = http2.connect(`http://localhost:${server.address().port}`); | ||
const req = client.request(src); | ||
req.on('response', common.mustCall(checkHeaders)); | ||
req.on('streamClosed', common.mustCall(() => { | ||
server.close(); | ||
client.destroy(); | ||
})); | ||
})); |
wondering if we should test the following case also:
On the other side, both header values should come through.