File: vars.t

package info (click to toggle)
libnginx-mod-http-headers-more-filter 1%3A0.39-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: ansic: 2,000; sh: 108; makefile: 3
file content (58 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# vi:ft=

use lib 'lib';
use Test::Nginx::Socket; # 'no_plan';

plan tests => 9;

no_diff;

run_tests();

__DATA__

=== TEST 1: vars
--- config
    location /foo {
        echo hi;
        set $val 'hello, world';
        more_set_headers 'X-Foo: $val';
    }
--- request
    GET /foo
--- response_headers
X-Foo: hello, world
--- response_body
hi



=== TEST 2: vars in both key and val
--- config
    location /foo {
        echo hi;
        set $val 'hello, world';
        more_set_headers '$val: $val';
    }
--- request
    GET /foo
--- response_headers
$val: hello, world
--- response_body
hi



=== TEST 3: vars in input header directives
--- config
    location /foo {
        set $val 'dog';
        more_set_input_headers 'Host: $val';
        echo $host;
    }
--- request
    GET /foo
--- response_body
dog
--- response_headers
Host: