File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -36,22 +36,26 @@ var HTTPServer = exports.HTTPServer = function (options) {
3636 var serverOptions = {
3737 before : ( options . before || [ ] ) . concat ( [
3838 function ( req , res ) {
39- options . logFn && options . logFn ( req , res ) ;
39+ if ( options . logFn ) {
40+ options . logFn ( req , res ) ;
41+ }
42+
4043 res . emit ( 'next' ) ;
4144 } ,
4245 ecstatic ( {
4346 root : this . root ,
4447 cache : this . cache ,
45- showDir : this . showDir ,
48+ showDir : this . showDir ,
4649 autoIndex : this . autoIndex ,
4750 defaultExt : this . ext
4851 } )
4952 ] ) ,
5053 headers : this . headers || { }
5154 } ;
5255
53- if ( options . https )
56+ if ( options . https ) {
5457 serverOptions . https = options . https ;
58+ }
5559
5660 this . server = union . createServer ( serverOptions ) ;
5761} ;
Original file line number Diff line number Diff line change 1414 ],
1515 "scripts" : {
1616 "start" : " node ./bin/http-server" ,
17+ "pretest" : " stylezero bin/ lib/ test" ,
1718 "test" : " vows --spec --isolate"
1819 },
1920 "contributors" : [
6364 },
6465 "devDependencies" : {
6566 "vows" : " 0.7.x" ,
66- "request" : " 2.21.x"
67+ "request" : " 2.21.x" ,
68+ "stylezero" : " 2.1.1"
6769 },
6870 "bugs" : {
6971 "url" : " https://github.com/nodeapps/http-server/issues"
You can’t perform that action at this time.
0 commit comments