File tree 2 files changed +9
-9
lines changed 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,7 @@ const {
13
13
} = require ( './http_server' ) ;
14
14
15
15
function createServer ( options , requestHandler ) {
16
- if ( typeof options === 'function' ) {
17
- requestHandler = options ;
18
- options = { } ;
19
- } else {
20
- stderr . write ( 'createServer was called with an options object. Unit ignores this for the time being.' ) ;
21
- }
22
-
23
- return new Server ( requestHandler ) ;
16
+ return new Server ( options , requestHandler ) ;
24
17
}
25
18
26
19
const http = require ( "http" )
Original file line number Diff line number Diff line change @@ -413,7 +413,14 @@ ServerRequest.prototype._read = function _read(n) {
413
413
} ;
414
414
415
415
416
- function Server ( requestListener ) {
416
+ function Server ( options , requestListener ) {
417
+ if ( typeof options === 'function' ) {
418
+ requestListener = options ;
419
+ options = { } ;
420
+ } else {
421
+ stderr . write ( 'createServer was called with an options object. Unit ignores this for the time being.' ) ;
422
+ }
423
+
417
424
EventEmitter . call ( this ) ;
418
425
419
426
this . unit = new unit_lib . Unit ( ) ;
You can’t perform that action at this time.
0 commit comments