-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http: add flushHeaders and deprecate flush
PR-URL: #1156 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Christian Tellnes <christian@tellnes.no> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
- Loading branch information
1 parent
68d4bed
commit b2e00e3
Showing
3 changed files
with
27 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'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(req.headers['foo'], 'bar'); | ||
res.end('ok'); | ||
server.close(); | ||
}); | ||
server.listen(common.PORT, '127.0.0.1', function() { | ||
let req = http.request({ | ||
method: 'GET', | ||
host: '127.0.0.1', | ||
port: common.PORT, | ||
}); | ||
req.setHeader('foo', 'bar'); | ||
req.flushHeaders(); | ||
}); |