From bf5ec5880825e26268e916a9943c652ceaabc239 Mon Sep 17 00:00:00 2001 From: short <> Date: Sun, 18 Sep 2005 19:29:52 +0000 Subject: [PATCH] Workarounded MIME::Base64 for 'Content-MD5' header. No longer warn on utf-8 &puts to Apache, it is just valid. --- Web.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Web.pm b/Web.pm index e8c89c7..07db01c 100644 --- a/Web.pm +++ b/Web.pm @@ -296,7 +296,8 @@ my($text,%args)=@_; delete $args{"undef"}; cluck join(" ","Invalid arguments:",keys(%args)) if keys(%args); return if !defined $text; - cluck "utf-8 untested" if Encode::is_utf8($text); + # Do not: cluck "utf-8 untested" if Encode::is_utf8($text); + # as it is valid here. $W->{"r"}->puts($text); } @@ -993,7 +994,8 @@ sub cache_finish() # as it will not provide the trailing filling '='s. # RFC 1864 is not clear but the same provides them. # FIXME: Should we somehow provide "\r\n" newlines for the text data? Which content is "text"? - $headers_out{"Content-MD5"}=MIME::Base64::encode_base64($W->{"digest-md5"}->digest()); + # ',""' to avoid breaking the headers by its default "\n". + $headers_out{"Content-MD5"}=MIME::Base64::encode_base64($W->{"digest-md5"}->digest(),""); # In fact we could also use MD5 for ETag as if we know ETag we also know MD5. # But this way we do not need to calculate MD5 and we still can provide such ETag. So. # $W->{"r"}->set_etag() ? -- 1.8.3.1