Skip to content

Commit

Permalink
http: support server options on createServer
Browse files Browse the repository at this point in the history
PR-URL: #19461
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
wesleytodd authored and targos committed Mar 30, 2018
1 parent 8a8b43e commit dac5f67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const {
ServerResponse
} = require('_http_server');

function createServer(requestListener) {
return new Server(requestListener);
function createServer(opts, requestListener) {
return new Server(opts, requestListener);
}

function request(options, cb) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-server-options-incoming-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MyIncomingMessage extends http.IncomingMessage {
}
}

const server = http.Server({
const server = http.createServer({
IncomingMessage: MyIncomingMessage
}, common.mustCall(function(req, res) {
assert.strictEqual(req.getUserAgent(), 'node-test');
Expand Down

0 comments on commit dac5f67

Please sign in to comment.