From df4892d939730fcad7ef43dbd36db4e01b20fa89 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 14 Sep 2009 13:29:27 +0200 Subject: tests:webclient: add User-Agent header to request. Michael --- tests/scripts/webclient.pl | 11 +++++++++-- 1 file 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; } -- cgit v1.2.3