@@ -135,7 +135,19 @@ export class Http1Server implements Printable {
135135 const codecs = this . codecs ;
136136 const ip = this . findIp ( req ) ;
137137 const token = this . findToken ( req ) ;
138- const ctx = new Http1ConnectionContext ( req , res , path , query , ip , token , match . params , new NullObject ( ) , codecs . value . json , codecs . value . json , codecs . messages . compact ) ;
138+ const ctx = new Http1ConnectionContext (
139+ req ,
140+ res ,
141+ path ,
142+ query ,
143+ ip ,
144+ token ,
145+ match . params ,
146+ new NullObject ( ) ,
147+ codecs . value . json ,
148+ codecs . value . json ,
149+ codecs . messages . compact ,
150+ ) ;
139151 const headers = req . headers ;
140152 const contentType = headers [ 'content-type' ] ;
141153 if ( typeof contentType === 'string' ) ctx . setCodecs ( contentType , codecs ) ;
@@ -180,12 +192,7 @@ export class Http1Server implements Printable {
180192
181193 public findIp ( req : http . IncomingMessage ) : string {
182194 const headers = req . headers ;
183- const ip = (
184- headers [ 'x-forwarded-for' ] ||
185- headers [ 'x-real-ip' ] ||
186- req . socket . remoteAddress ||
187- ''
188- ) ;
195+ const ip = headers [ 'x-forwarded-for' ] || headers [ 'x-real-ip' ] || req . socket . remoteAddress || '' ;
189196 return ip instanceof Array ? ip [ 0 ] : ip ;
190197 }
191198
@@ -236,9 +243,12 @@ export class Http1Server implements Printable {
236243 // ---------------------------------------------------------------- Printable
237244
238245 public toString ( tab : string = '' ) : string {
239- return `${ this . constructor . name } ` + printTree ( tab , [
240- ( tab ) => `HTTP ${ this . httpRouter . toString ( tab ) } ` ,
241- ( tab ) => `WebSocket ${ this . wsRouter . toString ( tab ) } ` ,
242- ] ) ;
246+ return (
247+ `${ this . constructor . name } ` +
248+ printTree ( tab , [
249+ ( tab ) => `HTTP ${ this . httpRouter . toString ( tab ) } ` ,
250+ ( tab ) => `WebSocket ${ this . wsRouter . toString ( tab ) } ` ,
251+ ] )
252+ ) ;
243253 }
244254}
0 commit comments