From: K. G. <kim...@gm...> - 2008-09-11 07:49:17
|
Hi Allister, On Wed, Sep 10, 2008 at 17:34, Allister Levi Sanchez <all...@gm...> wrote: > > I think it'd be better to parse the standard headers first in the handler > class (HttpTestHandler), to make it easier for people to write scripts for > various tests, and not have to duplicate code for the standard HTTP headers. > Besides, we only use HTTP_ALL_HEADERS for custom headers. We can then > write different CGI scripts for tests using different custom headers. So > having both could be beneficial. I'm thinking that it should be simple to build a little header dictionary that can parse the HTTP_ALL_HEADERS string, and use it from all CGI scripts. That way, the headers are available similarly to cgi.FieldStorage().headers, but in raw form. That said, my Python-Fu is not so strong, either, so I'm not sure what's involved in making a module that's importable from other scripts...? > Also, I think it's better that we expose the command handles do_GET, > do_POST, do_DELETE, etc. (as was the case in revision 90 of > http_test_server.py) at the level of the HttpTestHandler class as we are > most likely to overload them in the future to fully comply with RFC 2616. Ah, I just saw that they all delegated to the base, and so I figured they were redundant. To me it seems better to just override when necessary, but I don't have a strong opinion either way. - Kim |