diff options
author | Michael Adam <obnox@samba.org> | 2009-09-17 00:24:21 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-09-17 00:25:57 +0200 |
commit | aae8ae5d8d4027cbd457c0e3ff26cf4db8241247 (patch) | |
tree | 0465e6d4427caac6fa207198f0c6c7b5726e794c /tests | |
parent | b7d9256a7a673ec38da2448d9de879bfd7d1e9e4 (diff) |
tests:webclient: reduce duplication.
Michael
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/scripts/webclient.pl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/scripts/webclient.pl b/tests/scripts/webclient.pl index 84d8790..c9186c2 100755 --- a/tests/scripts/webclient.pl +++ b/tests/scripts/webclient.pl @@ -62,25 +62,24 @@ sub build_request($$$$$) if ($method ne 'GET') { die "invalid method '$method'"; } - $request = "$method $document$EOL" - . "$EOL"; + $request = "$method $document$EOL"; } elsif ($version eq '1.0') { if ($method ne 'GET') { die "invalid method '$method'"; } $request = "$method $document HTTP/$version$EOL" - . $user_agent_header - . "$EOL"; + . $user_agent_header; } elsif ($version eq '1.1') { $request = "$method $document HTTP/$version$EOL" . "Host: $host" . (($port and ($port ne $default_port))?":$port":"") . "$EOL" . $user_agent_header - . "Connection: close$EOL" - . "$EOL"; + . "Connection: close$EOL"; } else { die "invalid version '$version'"; } + $request .= $EOL; + return $request; } |