Message105633
If the CGI script crashes before finishing the headers, cgitb will emit invalid HTTP headers before showing the error message. Below are HTTP headers I received, captured with a packet sniffer. Note the "<--: spam".
HTTP/1.1 200 OK
Date: Thu, 13 May 2010 14:00:42 GMT
Server: Apache/2.2.9
<!--: spam
Vary: Accept-Encoding
Cache-Control: max-age=0
Expires: Thu, 13 May 2010 14:00:42 GMT
Set-Cookie: ref=; path=/; HttpOnly
Transfer-Encoding: chunked
Content-Type: text/html
That string it emitted by cgitb.reset(), which is trying to reset the browser to a sane state so the error message will be shown. The problem can be easily fixed by having cgitb.reset() emit two CRLF pairs first, to ensure that we're done with the headers and emitting content:
- return '''<!--: spam
+ return '''\r\n\r\n<!--: spam |
|
Date |
User |
Action |
Args |
2010-05-13 14:12:52 | stutzbach | set | recipients:
+ stutzbach |
2010-05-13 14:12:52 | stutzbach | set | messageid: <1273759972.28.0.178671810955.issue8704@psf.upfronthosting.co.za> |
2010-05-13 14:12:50 | stutzbach | link | issue8704 messages |
2010-05-13 14:12:49 | stutzbach | create | |
|