/
test0016.t
44 lines (26 loc) · 1.2 KB
/
test0016.t
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 v6;
use Test;
use LibCurl::Test;
use LibCurl::Easy;
plan 8;
my $server = LibCurl::Test.new;
$server.start;
my $curl = LibCurl::Easy.new(URL => "http://we.want.that.site.com/16",
proxy => "$HOSTIP:$HTTPPORT");
$curl.proxyuserpwd('fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong');
$curl.perform;
is $curl.response-code, 200, 'response-code';
is $server.input,
"GET http://we.want.that.site.com/16 HTTP/1.1
Proxy-Authorization: Basic ZmFrZUB1c2VyOmxvb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29uZw==
Host: we.want.that.site.com
Accept: */*
Proxy-Connection: Keep-Alive
", 'input';
is $curl.content, "the content goes here\n", 'Content';
is $curl.Content-Length, 22, 'Content-Length';
is $curl.statusline, "HTTP/1.1 200 OK", 'statusline';
is $curl.Funny-head, 'yesyes', 'header';
is $curl.Server, 'test-server/fake', 'Server';
is $curl.Content-Type, 'text/html', 'Content-Type';
done-testing;