0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-http-flush-headers.js
Sakthipriyan Vairamani aaf9b488e2 lib,test: update let to const where applicable
As per the `prefer-const` eslint rule, few instances of `let` have been
identified to be better with `const`. This patch updates all those
instances.

Refer: https://github.com/nodejs/node/issues/3118
PR-URL: https://github.com/nodejs/node/pull/3152
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-10-27 23:03:33 +05:30

21 lines
486 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');
const server = http.createServer();
server.on('request', function(req, res) {
assert.equal(req.headers['foo'], 'bar');
res.end('ok');
server.close();
});
server.listen(common.PORT, '127.0.0.1', function() {
const req = http.request({
method: 'GET',
host: '127.0.0.1',
port: common.PORT,
});
req.setHeader('foo', 'bar');
req.flushHeaders();
});