File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ use Test::Nginx;
22
22
select STDERR ; $| = 1;
23
23
select STDOUT ; $| = 1;
24
24
25
- my $t = Test::Nginx-> new()-> has(qw/ http proxy rewrite/ )-> plan(14 );
25
+ my $t = Test::Nginx-> new()-> has(qw/ http proxy rewrite/ )-> plan(15 );
26
26
27
27
$t -> write_file_expand(' nginx.conf' , <<'EOF' );
28
28
81
81
location /next {
82
82
proxy_pass http://u/;
83
83
}
84
+ location /redirect {
85
+ error_page 404 http://example.com/;
86
+ }
84
87
}
85
88
86
89
server {
@@ -165,6 +168,24 @@ like(
165
168
like(http_get_body(' /next' , ' 0123456789' ),
166
169
qr / X-Body: 0123456789\x0d ?$ / ms , ' body next upstream' );
167
170
171
+ # discarded request body in redirect via error_page
172
+
173
+ TODO: {
174
+ local $TODO = ' not yet' unless $t -> has_version(' 1.17.7' );
175
+
176
+ unlike(
177
+ http(
178
+ ' POST /redirect HTTP/1.1' . CRLF
179
+ . ' Host: localhost' . CRLF
180
+ . ' Content-Length: 10' . CRLF . CRLF
181
+ . ' 0123456789' .
182
+ ' GET /next HTTP/1.0' . CRLF . CRLF
183
+ ),
184
+ qr / 400 Bad Request/ ms , ' redirect - discard request body'
185
+ );
186
+
187
+ }
188
+
168
189
# ##############################################################################
169
190
170
191
sub read_body_file {
You can’t perform that action at this time.
0 commit comments