@@ -21,7 +21,7 @@ use Test::Nginx;
21
21
select STDERR ; $| = 1;
22
22
select STDOUT ; $| = 1;
23
23
24
- my $t = Test::Nginx-> new()-> has(qw/ http proxy rewrite/ )-> plan(7 )
24
+ my $t = Test::Nginx-> new()-> has(qw/ http proxy rewrite/ )-> plan(9 )
25
25
-> write_file_expand(' nginx.conf' , <<'EOF' );
26
26
27
27
%%TEST_GLOBALS%%
@@ -63,6 +63,20 @@ http {
63
63
return 302 "http://example.com/";
64
64
}
65
65
66
+ location /error302return302args {
67
+ error_page 302 /return302args?1;
68
+ return 302 "first";
69
+ }
70
+
71
+ location /error302return302varargs {
72
+ error_page 302 /return302args?$arg_a;
73
+ return 302 "first";
74
+ }
75
+
76
+ location /return302args {
77
+ return 302 "http://example.com/$args";
78
+ }
79
+
66
80
location /error302rewrite {
67
81
error_page 302 /rewrite;
68
82
return 302 "first";
@@ -116,6 +130,14 @@ like(http_get('/error302return302text'),
116
130
qr { HTTP/1.1 302(?!.*Location: first).*Location: http://example.com/} ms ,
117
131
' error 302 return 302 text - old location cleared' );
118
132
133
+ like(http_get(' /error302return302args' ),
134
+ qr { HTTP/1.1 302(?!.*Location: first).*Location: http://example.com/1} ms ,
135
+ ' error 302 return 302 args - old location cleared' );
136
+
137
+ like(http_get(' /error302return302varargs?a=2' ),
138
+ qr { HTTP/1.1 302(?!.*Location: first).*Location: http://example.com/2} ms ,
139
+ ' error 302 return 302 var args - old location cleared' );
140
+
119
141
like(http_get(' /error302rewrite' ),
120
142
qr { HTTP/1.1 302(?!.*Location: first).*Location: http://example.com/} ms ,
121
143
' error 302 rewrite - old location cleared' );
0 commit comments