File: eval.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 (36 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (7)
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
# vi:filetype=

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

repeat_each(3);

plan tests => repeat_each() * 2 * blocks();

#no_long_string();
#no_diff;

run_tests();

__DATA__

=== TEST 1: set request header at client side
--- config
    location /foo {
        eval_subrequest_in_memory off;
        eval_override_content_type text/plain;
        eval $res {
            echo -n 1;
        }
        #echo "[$res]";
        if ($res = '1') {
            more_set_input_headers 'Foo: Bar';
            echo "OK";
            break;
        }
        echo "NOT OK";
    }
--- request
    GET /foo
--- response_body
OK