Hi all,

I got the filter to work. I just added 3 lines of code in "ZPublisher.HTTPResponse.HTTPResponse" (thanks for your suggestion, Dieter):

doctype_str_search = re.compile(r'<!DOCTYPE.*>')
body = doctype_str_search.sub('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>', body)

        body = body.replace('/>', '>')

It works great except that... it breaks the WebDAV ( I can still connect but can't see the files).

I'd like to add a condition there: if WebDAV, don't do anything. But all I have is the body. No port, for instance...

I thought of testing: if content type = 'text/html', byt WebDAV will probably be of that type.

Any suggestion will be wecome.


Dieter Maurer wrote:
Cyrille Bonnet wrote at 2005-5-5 14:58 +1200:

I am trying to perform a post-processing on all HTTP responses, before they get sent to the browsers. I am using Zope 2.7.3 nad Plone 2.0.5.

I had a look at the ZServer class: it seems to be the right place, but I don't understand all the code there and I am afraid to break something :-(

I think "ZPublisher.HTTPResponse.HTTPResponse" is the better
place for tidying up.

Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to