Skip to content

Commit ced0a86

Browse files
committed
Tests: fastcgi_catch_stderr test.
1 parent 3339c0a commit ced0a86

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

fastcgi.t

+8-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ eval { require FCGI; };
2525
plan(skip_all => 'FCGI not installed') if $@;
2626
plan(skip_all => 'win32') if $^O eq 'MSWin32';
2727

28-
my $t = Test::Nginx->new()->has(qw/http fastcgi/)->plan(7)
28+
my $t = Test::Nginx->new()->has(qw/http fastcgi/)->plan(8)
2929
->write_file_expand('nginx.conf', <<'EOF');
3030
3131
%%TEST_GLOBALS%%
@@ -51,6 +51,12 @@ http {
5151
fastcgi_param REQUEST_URI $request_uri;
5252
}
5353
54+
location /catch {
55+
fastcgi_pass 127.0.0.1:8081;
56+
fastcgi_param REQUEST_URI "/stderr";
57+
fastcgi_catch_stderr sample;
58+
}
59+
5460
location /var {
5561
fastcgi_pass $arg_b;
5662
fastcgi_param REQUEST_URI $request_uri;
@@ -72,6 +78,7 @@ like(http_get('/'), qr/^3$/m, 'fastcgi third request');
7278
unlike(http_head('/'), qr/SEE-THIS/, 'no data in HEAD');
7379

7480
like(http_get('/stderr'), qr/SEE-THIS/, 'large stderr handled');
81+
like(http_get('/catch'), qr/502 Bad/, 'catch stderr');
7582

7683
like(http_get('/var?b=127.0.0.1:' . port(8081)), qr/SEE-THIS/,
7784
'fastcgi with variables');

0 commit comments

Comments
 (0)