File: CVE-2005-3357.t

package info (click to toggle)
apache2 2.4.66-7
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 59,876 kB
  • sloc: ansic: 212,340; python: 13,830; perl: 11,307; sh: 7,266; php: 1,320; javascript: 1,314; awk: 749; makefile: 715; lex: 374; yacc: 161; xml: 2
file content (51 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download | duplicates (8)
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
use strict;
use warnings FATAL => 'all';

# Test case for PR 33791.

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

BEGIN {
   # prevent TestRequest from croaking on an HTTP/0.9 response
   $ENV{APACHE_TEST_HTTP_09_OK} = 1;
}

my $vars = Apache::Test::vars();

plan tests => 3, need $vars->{ssl_module_name}, need_lwp,
    qw(LWP::Protocol::https);

Apache::TestRequest::user_agent_keepalive(0);

my $config = Apache::Test::config();

Apache::TestRequest::module("ssl_pr33791");

my $hostport = Apache::TestRequest::hostport();

my $rurl = "http://" . $hostport . "/";

t_debug("URL is $rurl");

my $r = GET($rurl);

my $proto = $r->protocol;

ok $proto;

if (!$proto) {
    skip "server gave no response";
} else {
    if ($proto eq "HTTP/0.9") {
        skip "server gave HTTP/0.9 response";
    } elsif ($proto) {    
        ok t_cmp($r->code,
                 400,
                 "Expected bad request from 'GET $rurl'"
                 );
    }
}

ok t_cmp($r->content, qr/welcome to localhost/, "errordoc content was served");