diff options
author | Michael Adam <obnox@samba.org> | 2009-09-14 13:29:27 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-09-14 13:30:58 +0200 |
commit | df4892d939730fcad7ef43dbd36db4e01b20fa89 (patch) | |
tree | 0fe41c3a10ea0253ee433b0292da0b2fe188bd06 /tests | |
parent | 8c5391ab6e1d1c31da011f5494ce79fc3072186e (diff) |
tests:webclient: add User-Agent header to request.
Michael
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/scripts/webclient.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/scripts/webclient.pl b/tests/scripts/webclient.pl index ed20f42..bdc8765 100755 --- a/tests/scripts/webclient.pl +++ b/tests/scripts/webclient.pl @@ -23,7 +23,10 @@ use strict; use IO::Socket; my $EOL = "\015\012"; -my $BLANK = $EOL x 2; + +my $VERSION = "0.1"; +my $NAME = "Tinyproxy-Web-Client"; +my $user_agent = "$NAME/$VERSION"; unless (@ARGV > 1) { die "usage: $0 host[:port] document ..."; @@ -49,9 +52,13 @@ foreach my $document (@ARGV) { $remote->autoflush(1); - print $remote "GET $document HTTP/1.0" . $BLANK; + print $remote "GET $document HTTP/1.0" . $EOL . + "User-Agent: $user_agent$EOL" . + $EOL; + while (<$remote>) { print; } + close $remote; } |