@@ -10,7 +10,8 @@ function execute(options) {
1010 const expectHeaders = {
1111 'x-foo' : 'boom' ,
1212 'cookie' : 'a=1; b=2; c=3' ,
13- 'connection' : 'keep-alive'
13+ 'connection' : 'keep-alive' ,
14+ 'host' : 'example.com' ,
1415 } ;
1516
1617 // no Host header when you set headers an array
@@ -43,13 +44,20 @@ function execute(options) {
4344// Should be the same except for implicit Host header on the first two
4445execute ( { headers : { 'x-foo' : 'boom' , 'cookie' : 'a=1; b=2; c=3' } } ) ;
4546execute ( { headers : { 'x-foo' : 'boom' , 'cookie' : [ 'a=1' , 'b=2' , 'c=3' ] } } ) ;
46- execute ( { headers : [ [ 'x-foo' , 'boom' ] , [ 'cookie' , 'a=1; b=2; c=3' ] ] } ) ;
4747execute ( { headers : [
48- [ 'x-foo' , 'boom' ] , [ 'cookie' , [ 'a=1' , 'b=2' , 'c=3' ] ] ,
48+ [ 'x-foo' , 'boom' ] ,
49+ [ 'cookie' , 'a=1; b=2; c=3' ] ,
50+ [ 'Host' , 'example.com' ] ,
51+ ] } ) ;
52+ execute ( { headers : [
53+ [ 'x-foo' , 'boom' ] ,
54+ [ 'cookie' , [ 'a=1' , 'b=2' , 'c=3' ] ] ,
55+ [ 'Host' , 'example.com' ] ,
4956] } ) ;
5057execute ( { headers : [
5158 [ 'x-foo' , 'boom' ] , [ 'cookie' , 'a=1' ] ,
52- [ 'cookie' , 'b=2' ] , [ 'cookie' , 'c=3' ] ,
59+ [ 'cookie' , 'b=2' ] , [ 'cookie' , 'c=3' ] ,
60+ [ 'Host' , 'example.com' ] ,
5361] } ) ;
5462
5563// Authorization and Host header both missing from the second
@@ -58,4 +66,5 @@ execute({ auth: 'foo:bar', headers:
5866execute ( { auth : 'foo:bar' , headers : [
5967 [ 'x-foo' , 'boom' ] , [ 'cookie' , 'a=1' ] ,
6068 [ 'cookie' , 'b=2' ] , [ 'cookie' , 'c=3' ] ,
69+ [ 'Host' , 'example.com' ] ,
6170] } ) ;
0 commit comments