@@ -10,7 +10,8 @@ function execute(options) {
10
10
const expectHeaders = {
11
11
'x-foo' : 'boom' ,
12
12
'cookie' : 'a=1; b=2; c=3' ,
13
- 'connection' : 'keep-alive'
13
+ 'connection' : 'keep-alive' ,
14
+ 'host' : 'example.com' ,
14
15
} ;
15
16
16
17
// no Host header when you set headers an array
@@ -43,13 +44,20 @@ function execute(options) {
43
44
// Should be the same except for implicit Host header on the first two
44
45
execute ( { headers : { 'x-foo' : 'boom' , 'cookie' : 'a=1; b=2; c=3' } } ) ;
45
46
execute ( { headers : { 'x-foo' : 'boom' , 'cookie' : [ 'a=1' , 'b=2' , 'c=3' ] } } ) ;
46
- execute ( { headers : [ [ 'x-foo' , 'boom' ] , [ 'cookie' , 'a=1; b=2; c=3' ] ] } ) ;
47
47
execute ( { 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' ] ,
49
56
] } ) ;
50
57
execute ( { headers : [
51
58
[ 'x-foo' , 'boom' ] , [ 'cookie' , 'a=1' ] ,
52
- [ 'cookie' , 'b=2' ] , [ 'cookie' , 'c=3' ] ,
59
+ [ 'cookie' , 'b=2' ] , [ 'cookie' , 'c=3' ] ,
60
+ [ 'Host' , 'example.com' ] ,
53
61
] } ) ;
54
62
55
63
// Authorization and Host header both missing from the second
@@ -58,4 +66,5 @@ execute({ auth: 'foo:bar', headers:
58
66
execute ( { auth : 'foo:bar' , headers : [
59
67
[ 'x-foo' , 'boom' ] , [ 'cookie' , 'a=1' ] ,
60
68
[ 'cookie' , 'b=2' ] , [ 'cookie' , 'c=3' ] ,
69
+ [ 'Host' , 'example.com' ] ,
61
70
] } ) ;
0 commit comments