[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Help: unwanted extra characters in output
From:       "Hendrik Schumacher" <hs () activeframe ! de>
Date:       2010-09-22 7:30:16
Message-ID: 6414aed41498f6d34a5a9abbaf001eb0.squirrel () www ! activeframe ! de
[Download RAW message or body]

Btw, if you simply want to disable chunked encoding, buffer your output in
your mod_perl handler, set the Content-Length response header once your
output is complete and only after that print your output.

Apache only activates chunked encoding if no Content-Length header is
present when output is sent.

Hendrik

Am Mi, 22.09.2010, 06:44, schrieb Nico Coetzee:
> Hi - I have a problem which I can't seem to solve.
>
> I am busy implementing a webdav solution in mod_perl and as you may
> know, the output is XML based.
>
> The problem is that the output generated by mod_perl contains
> additional characters before and after the XML which the webdav
> clients don't seem to like.
>
> If I convert this script to a CGI, it works 100% and the extra
> characters is not present.
>
> Any ideas?
>
> Here is the example trace (check the "20d" and "0" before and after the
> XML):
>
> PROPFIND /webdav/ HTTP/1.1
> Host: test:81
> User-Agent: cadaver/0.22.3 neon/0.25.5
> Connection: TE
> TE: trailers
> Depth: 0
> Content-Length: 297
> Content-Type: application/xml
> Authorization: Basic dGVzdHVzZXIxOnBhc3N3b3Jk
>
> <?xml version="1.0" encoding="utf-8"?>
> <propfind xmlns="DAV:"><prop>
> <getcontentlength xmlns="DAV:"/>
> <getlastmodified xmlns="DAV:"/>
> <executable xmlns="http://apache.org/dav/props/"/>
> <resourcetype xmlns="DAV:"/>
> <checked-in xmlns="DAV:"/>
> <checked-out xmlns="DAV:"/>
> </prop></propfind>
>
> HTTP/1.1 200 OK
> Date: Wed, 22 Sep 2010 04:25:57 GMT
> Server: Apache/2.2.3 (CentOS)
> Cache-Control: max-age=0
> Expires: Wed, 22 Sep 2010 04:25:57 GMT
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/xtml; charset="utf-8"
>
> 20d
> <?xml version="1.0" encoding="utf-8"?>
> <D:multistatus xmlns:D="DAV:"><D:response xmlns:lp1="DAV:"
> xmlns:lp2="http://apache.org/dav/props/">
> <D:href></D:href><D:propstat><D:prop>
> <lp1:resourcetype><D:collection/></lp1:resourcetype>
> <lp1:getlastmodified>2010-09-14T05:09:29Z</lp1:getlastmodified>
> <lp1:executable>F</lp1:executable>
> <lp1:getcontentlength>4096</lp1:getcontentlength>
> <D:checked-in />
> <D:checked-out />
> <D:lockdiscovery/>
> </D:prop>
> <D:status>HTTP/1.1 200 OK</D:status>
> </D:propstat>
> </D:response>
> </D:multistatus>
> 0
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic