HTTP/Daemon.pm & UTF-8

HTTP/Daemon.pm & UTF-8

am 02.05.2006 23:07:12 von erwan

--fOHHtNG4YXGJ0yqR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


Hello ,

It seems that HTTP/Daemon.pm is bogus when it calculate
the header 'Content-Length' when the data contains UTF8 data .

In attachement a patch , to calculate the length in bytes
of the data .

--
____________________________________________________________
/ Erwan MAS /\
| mailto:erwan@mas.nom.fr |_/
___|________________________________________________________ |
\___________________________________________________________ \__/

--fOHHtNG4YXGJ0yqR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="Daemon.pm.patch"

--- Daemon.pm.orig 2004-12-11 16:13:22.000000000 +0100
+++ Daemon.pm 2006-05-02 22:53:33.660393022 +0200
@@ -436,7 +436,7 @@
}
}
elsif (length($content)) {
- $res->header("Content-Length" => length($content));
+ $res->header("Content-Length" => bytes::length($content));
}
else {
$self->force_last_request;

--fOHHtNG4YXGJ0yqR--