[Spambayes] end of problems?
Emperor
DarkEmperor at gmx.net
Thu Sep 25 18:04:26 EDT 2003
Ok, normally I code in Java... but couldn't wait.
So I changed the function
def writeOKHeaders(self, contentType, extraHeaders={}):
"""Reflected from `HTTPPlugin`s."""
# Buffer the headers until there's a `write`, in case an error
occurs.
timeNow = time.gmtime(time.time())
httpNow = time.strftime('%a, %d %b %Y %H:%M:%S GMT', timeNow)
headers = []
headers.append("HTTP/1.1 200 OK")
headers.append("Connection: close")
headers.append("Content-Type: %s" % contentType)
headers.append("Date: %s" % httpNow)
# added cache control to always get newest page
headers.append("Expires: 26 May 2000 16:00:00 GMT")
headers.append("Cache-Control: no-cache")
for name, value in extraHeaders.items():
headers.append("%s: %s" % (name, value))
headers.append("")
headers.append("")
self._bufferedHeaders = headers
Now it's just copy paste ;)
More information about the Spambayes
mailing list