[Zope-dev] Several bugs in Zope 2 CVS to bounce

Martijn Pieters mj@antraciet.nl
Wed, 04 Aug 1999 10:45:48 +0200


At 20:50 03/08/99 , Amos Latteier wrote:
>At 04:27 PM 8/3/99 +0200, Martijn Pieters wrote:
>
> >I came across a few issues, I'd like to bounce around here before posting
> >them to the CVS:
> >
> >- ZServer/Medusa is very picky about the request formats, and doesn't
> >generate proper errors about them.
> >
> >For instance, if the request uses only LF for line-endings, instead of
> >CRLF, nothing happens. I mean: really nothing. The request is dicarded, no
> >exceptions are logged, nothing, nada.
> >
> >It took me about 2 hours to figure this one out. A 'HTTP/1.1 400 Bad
> >Request' would have been helpful here.
>
>Hmm. This is bad. I'll look into this. You may wish to post this to the
>medusa list also. (medusa@egroups.com)

Will do.


> >Medusa also cannot abide any extra spaces in de first request line, like:
> >'POST /purchase/check  HTTP/1.0' (watch it, there are two spaces between
> >'check' and 'HTTP'). This time there is an exception logged, because the
> >regular expression that tries to parse this line bounces. Again, at least a
> >'HTTP/1.0 500 Server Error' would have been helpful, but in this case
> >should be another 400 Bad Request response.
>
>I just wrote a patch for this kind of broken HTTP request. If the request
>isn't totally right, it tries to use the first, second and last space
>delimited items. It also returns 400 if it can't figure out what the
>request should be.

Wonderful. I had hacked the regexp to allow for more whitespace, but your 
patch is better, and adds error reporting.


> >In my particular case, the requests are sent by a third party server, and
> >the owners are willing to tweak their code, and I can teak Medusa. But
> >maybe Medusa should be more flexible in accepting minimally malformed
> >requests, by changing LF's to CRLF's and allowing for more whitespace in
> >request headers.
>
>This is a great thing to say to Sam Rushing. We can change Zope's medusa,
>but for most core changes I really want to make sure we get Sam on board.

Again, will do.


> >- MailHost objects are broken, I cannot add new ones:
> >Traceback (innermost last):
> >   File /usr/people/sneek/src/Zope2/lib/python/ZPublisher/Publish.py, line
> >256, in publish_module
> >   File /usr/people/sneek/src/Zope2/lib/python/ZPublisher/Publish.py, line
> >145, in publish
> >   File /usr/people/sneek/src/Zope2/lib/python/ZPublisher/BaseRequest.py,
> >line 311, in traverse
> >   File /usr/people/sneek/src/Zope2/lib/python/App/FactoryDispatcher.py,
> >line 143, in __getattr__
> >KeyError: manage_addMailHost
>
>Hmm. I can't reproduce this one.
>
> >When I revert to the old __init__.py, or use an existing Mailhost object,
> >and I use the sendmail tag, I get an attribute error, no such method named
> >'__call--' (sorry, no traceback, haven't got the access right now). It
> >happens when line 182 of SendMailTag.py is called: mhost=md[self.mailhost]
> >
> >The namespace object (md) is trying to call the mailhost). Maybe this
> >should read:
> >      mhost=md.getitem(self.mailhost, call=0)
>
>Nor this one.
>
>BTW, make sure you are up to date with CVS. When I switched MailHost from
>the old init to the new one I didn't get it exactly right the first time ;-)
>
>-Amos

This is the latest CVS. A clean install even. Maybe you should delete the 
MailHost product from your products folder, and restart Zope. I found that 
helps with Products that don't have a version number that Zope can check 
on, or when the version number hasn't changed (version.txt).


--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------