diff --git a/test/compression.js b/test/compression.js index e88befb..b6166eb 100644 --- a/test/compression.js +++ b/test/compression.js @@ -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')