Skip to content

Commit

Permalink
Node.js 0.8 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
lamweili committed Aug 2, 2022
1 parent 349ce2f commit 12eb09c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -2313,9 +2313,10 @@ describe('session()', function(){
})
server.on('listening', function () {
var client = createHttp2Client(server.address().port)
var request = client.request({
[http2.constants.HTTP2_HEADER_PATH]: '/'
})
// using ES5 as Node.js <=4.0.0 does not have Computed Property Names
var reqHeaders = {}
reqHeaders[http2.constants.HTTP2_HEADER_PATH] = '/'
var request = client.request(reqHeaders)
request.on('response', function (headers) {
assert.strictEqual(headers[http2.constants.HTTP2_HEADER_STATUS], 200)
assert.strictEqual(headers[http2.constants.HTTP2_HEADER_CONTENT_TYPE], 'text/plain')
Expand Down

0 comments on commit 12eb09c

Please sign in to comment.