Skip to content

Commit b2a661f

Browse files
Jake ChampionJakeChampion
authored andcommitted
chore: add test to confirm response-handles with multiple values for the same header name is supported
1 parent a69d8b2 commit b2a661f

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

integration-tests/js-compute/fixtures/multiple-set-cookie/bin/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ routes.set('/', () => {
4545
h.append("Set-Cookie", "test9=9");
4646
h.append("Set-Cookie", "test10=10");
4747
h.append("Set-Cookie", "test11=11");
48-
4948
let r = new Response("Hello", {
5049
headers: h
5150
});
@@ -67,4 +66,11 @@ routes.set('/', () => {
6766
r.headers.append("Set-Cookie", "test11=11");
6867
return r;
6968
});
69+
routes.set("/multiple-set-cookie/downstream", async () => {
70+
let response = await fetch('https://httpbin.org/cookies/set?1=1&2=2&3=3&4=4&5=5&6=6&7=7&8=8&9=9&10=10&11=11', {
71+
backend: 'httpbin'
72+
});
73+
74+
return new Response('', response);
75+
});
7076
}

integration-tests/js-compute/fixtures/multiple-set-cookie/fastly.toml.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,14 @@ service_id = ""
1010

1111
[scripts]
1212
build = "node ../../../../js-compute-runtime-cli.js"
13+
14+
[local_server]
15+
[local_server.backends]
16+
[local_server.backends.httpbin]
17+
url = "https://httpbin.org/"
18+
19+
[setup]
20+
[setup.backends]
21+
[setup.backends.httpbin]
22+
address = "httpbin.org"
23+
port = 443

integration-tests/js-compute/fixtures/multiple-set-cookie/tests.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,30 @@
4848
["Set-Cookie", "test11=11"]
4949
]
5050
}
51+
},
52+
"GET /multiple-set-cookie/downstream": {
53+
"environments": ["viceroy", "c@e"],
54+
"downstream_request": {
55+
"method": "GET",
56+
"pathname": "/multiple-set-cookie/downstream"
57+
},
58+
"downstream_response": {
59+
"status": 200,
60+
"headers": [
61+
["Set-Cookie", "test=1; expires=Tue, 06-Dec-2022 12:34:56 GMT; Max-Age=60; Path=/; HttpOnly; Secure"],
62+
["Set-Cookie", "test_id=1; Max-Age=60; Path=/; expires=Tue, 06-Dec-2022 12:34:56 GMT"],
63+
["Set-Cookie", "test_id=1; Max-Age=60; Path=/; expires=Tue, 06-Dec-2022 12:34:56 GMT"],
64+
["Set-Cookie", "test2=2"],
65+
["Set-Cookie", "test3=3"],
66+
["Set-Cookie", "test4=4"],
67+
["Set-Cookie", "test5=5"],
68+
["Set-Cookie", "test6=6"],
69+
["Set-Cookie", "test7=7"],
70+
["Set-Cookie", "test8=8"],
71+
["Set-Cookie", "test9=9"],
72+
["Set-Cookie", "test10=10"],
73+
["Set-Cookie", "test11=11"]
74+
]
75+
}
5176
}
5277
}

0 commit comments

Comments
 (0)