File: err_headers_out.t

package info (click to toggle)
libapache2-mod-perl2 2.0.4-5%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 9,868 kB
  • ctags: 3,820
  • sloc: perl: 56,663; ansic: 14,001; makefile: 91; sh: 38
file content (44 lines) | stat: -rw-r--r-- 982 bytes parent folder | download | duplicates (3)
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
use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestRequest;
use Apache::TestUtil;

plan tests => 6, need 'HTML::HeadParser';

my $location = '/TestAPI__err_headers_out';

{
    # with 2xx responses any of the err_headers_out and headers_out
    # headers make it through

    my $res = GET "$location?200";

    #t_debug $res->as_string;

    ok t_cmp $res->code, 200, "OK";

    ok t_cmp $res->header('X-err_headers_out'), "err_headers_out",
        "X-err_headers_out: made it";

    ok t_cmp $res->header('X-headers_out'), "headers_out",
        "X-headers_out: made it";
}

{
    # with non-2xx responses only the err_headers_out headers make it
    # through. the headers_out do not make it.

    my $res = GET "$location?404";

    #t_debug $res->as_string;

    ok t_cmp $res->code, 404, "not found";

    ok t_cmp $res->header('X-err_headers_out'), "err_headers_out",
        "X-err_headers_out: made it";

    ok !$res->header('X-headers_out');
}