MOON
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4
System: Linux vps.panamaemb.org.sg 3.10.0-1160.80.1.vz7.191.4 #1 SMP Thu Dec 15 20:31:06 MSK 2022 x86_64
User: panama (500)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/2/cwd/installd/perl588installer/libwww-perl-5.823/t/live/jigsaw-md5-get.t
print "1..2\n";

use strict;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new(keep_alive => 1);

my $res = $ua->get(
  "http://jigsaw.w3.org/HTTP/h-content-md5.html",
    "TE" => "deflate",
);

use Digest::MD5 qw(md5_base64);
print "not " unless $res->header("Content-MD5") eq md5_base64($res->content) . "==";
print "ok 1\n";

print $res->as_string;

my $etag = $res->header("etag");

$res = $ua->get(
  "http://jigsaw.w3.org/HTTP/h-content-md5.html",
    "TE" => "deflate",
    "If-None-Match" => $etag,
);
print $res->as_string;

print "not " unless $res->code eq "304" && $res->header("Client-Response-Num") == 2;
print "ok 2\n";