# HG changeset patch # User Maxim Dounin # Date 1313618397 -14400 # Node ID b8fdbc9182809addc4dabac359385f10ab5826ee # Parent c0ae296329059ee095016abd71eb69ce4bfaf39e Tests: add scgi headers_param test. diff --git a/scgi.t b/scgi.t --- a/scgi.t +++ b/scgi.t @@ -24,7 +24,7 @@ select STDOUT; $| = 1; eval { require SCGI; }; plan(skip_all => 'SCGI not installed') if $@; -my $t = Test::Nginx->new()->has(qw/http scgi/)->plan(4) +my $t = Test::Nginx->new()->has(qw/http scgi/)->plan(5) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -45,6 +45,7 @@ http { scgi_pass 127.0.0.1:8081; scgi_param SCGI 1; scgi_param REQUEST_URI $request_uri; + scgi_param HTTP_X_BLAH "blah"; } } } @@ -62,6 +63,45 @@ like(http_get('/'), qr/^3$/m, 'scgi thir unlike(http_head('/'), qr/SEE-THIS/, 'no data in HEAD'); +SKIP: { +skip 'unsafe', 1 unless $ENV{TEST_NGINX_UNSAFE}; +local $TODO = 'not yet'; + +like(http_get_headers('/headers'), qr/SEE-THIS/, + 'scgi request with many ignored headers'); + +} + +############################################################################### + +sub http_get_headers { + my ($url, %extra) = @_; + return http(<