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 <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
wesleytodd authored and tniessen committed Mar 25, 2018
1 parent c1ed782 commit 42d8ea0
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 42d8ea0

Please sign in to comment.