@@ -82,25 +82,22 @@ describe('getConnInfo', () => {
8282 xff : '127.0.0.1, 192.168.1.100' ,
8383 expected : '192.168.1.100' ,
8484 } ,
85- ] ) (
86- 'Should return the last IP from x-forwarded-for ($description)' ,
87- ( { xff, expected } ) => {
88- const req = new Request ( 'http://localhost/' , {
89- headers : { 'x-forwarded-for' : xff } ,
90- } )
91- const c = new Context ( req , {
92- env : {
93- requestContext : {
94- elb : {
95- targetGroupArn : 'arn:aws:elasticloadbalancing:...' ,
96- } ,
85+ ] ) ( 'Should return the last IP from x-forwarded-for ($description)' , ( { xff, expected } ) => {
86+ const req = new Request ( 'http://localhost/' , {
87+ headers : { 'x-forwarded-for' : xff } ,
88+ } )
89+ const c = new Context ( req , {
90+ env : {
91+ requestContext : {
92+ elb : {
93+ targetGroupArn : 'arn:aws:elasticloadbalancing:...' ,
9794 } ,
9895 } ,
99- } )
100- const info = getConnInfo ( c )
101- expect ( info . remote . address ) . toBe ( expected )
102- }
103- )
96+ } ,
97+ } )
98+ const info = getConnInfo ( c )
99+ expect ( info . remote . address ) . toBe ( expected )
100+ } )
104101
105102 it ( 'Should return undefined when no x-forwarded-for header' , ( ) => {
106103 const c = new Context ( new Request ( 'http://localhost/' ) , {
0 commit comments