@@ -22,7 +22,7 @@ select STDERR; $| = 1;
22
22
select STDOUT ; $| = 1;
23
23
24
24
my $t = Test::Nginx-> new()-> has(qw/ http proxy cache gzip rewrite/ )
25
- -> plan(49 )-> write_file_expand(' nginx.conf' , <<'EOF' );
25
+ -> plan(52 )-> write_file_expand(' nginx.conf' , <<'EOF' );
26
26
27
27
%%TEST_GLOBALS%%
28
28
@@ -93,6 +93,12 @@ http {
93
93
add_header Vary ",, Accept-encoding , ,";
94
94
}
95
95
96
+ location /multi {
97
+ gzip off;
98
+ add_header Vary Accept-Encoding;
99
+ add_header Vary Foo;
100
+ }
101
+
96
102
location /cold {
97
103
expires max;
98
104
add_header Vary $arg_vary;
106
112
$t -> write_file(' index.html' , ' SEE-THIS' );
107
113
$t -> write_file(' asterisk' , ' SEE-THIS' );
108
114
$t -> write_file(' complex' , ' SEE-THIS' );
115
+ $t -> write_file(' multi' , ' SEE-THIS' );
109
116
$t -> write_file(' cold' , ' SEE-THIS' );
110
117
111
118
$t -> run();
@@ -255,6 +262,18 @@ like(get('/', 'bar,foo'), qr/HIT/ms, 'normalize order');
255
262
256
263
}
257
264
265
+ # Multiple Vary headers (ticket #1423).
266
+
267
+ like(get(' /multi' , ' foo' ), qr / MISS/ ms , ' multi first' );
268
+ like(get(' /multi' , ' foo' ), qr / HIT/ ms , ' multi second' );
269
+
270
+ TODO: {
271
+ local $TODO = ' not yet' unless $t -> has_version(' 1.23.0' );
272
+
273
+ like(get(' /multi' , ' bar' ), qr / MISS/ ms , ' multi other' );
274
+
275
+ }
276
+
258
277
# keep c->body_start when Vary changes (ticket #2029)
259
278
260
279
# before 1.19.3, this prevented updating c->body_start of a main key
0 commit comments