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 78cac20 commit 4c1d27b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/compression.js
Expand Up @@ -323,9 +323,10 @@ describe('compression()', function () {
})
server.on('listening', function () {
var client = createHttp2Client(server.address().port)
var request = client.request({
[http2.constants.HTTP2_HEADER_ACCEPT_ENCODING]: 'gzip'
})
// using ES5 as Node.js <=4.0.0 does not have Computed Property Names
var reqHeaders = {}
reqHeaders[http2.constants.HTTP2_HEADER_ACCEPT_ENCODING] = 'gzip'
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 4c1d27b

Please sign in to comment.