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
|
# test chunked http connection over http relay invoking the callback
# The client writes a bad chunk length in the second chunk.
# Check that the relay handles the input after the error correctly.
use strict;
use warnings;
my @lengths = ([4, 3]);
our %args = (
client => {
func => sub {
my $self = shift;
print <<'EOF';
PUT /4/3 HTTP/1.1
Host: foo.bar
Transfer-Encoding: chunked
4
123
XXX
3
12
0
EOF
print STDERR "LEN: 4\n";
print STDERR "LEN: 3\n";
# relayd does not forward the first chunk if the second one
# is invalid. So do not expect any response.
#http_response($self, "without len");
},
http_vers => ["1.1"],
lengths => \@lengths,
method => "PUT",
},
relayd => {
protocol => [ "http",
"match request header log foo",
"match response header log bar",
],
loggrep => {
qr/, invalid chunk size, PUT/ => 1,
},
},
server => {
func => \&http_server,
nocheck => 1,
},
lengths => \@lengths,
);
1;
|