[Twisted-web] http exception in stringToDateTime

James Y Knight foom at fuhm.net
Tue Apr 26 10:17:46 MDT 2005


On Apr 26, 2005, at 12:05 PM, Andrea Arcangeli wrote:
> It sounds a minor bug in twisted/web not in my app. I won't have time  
> to debug
> this myself until tomorrow, it's not very urgent since this is the  
> first time
> it happened, and no other user reproduced this problem.

It is a "feature" of old versions of netscape, as well as current  
versions of MSIE when configured to use a HTTP 1.0 proxy (I think).  
MSIE is totally RFC-violating, but what can you do. It was fixed in  
t.web by r13529, which is a 1-line patch:

Modified: trunk/twisted/web/http.py
======================================================================== 
======
--- trunk/twisted/web/http.py	(original)
+++ trunk/twisted/web/http.py	Tue Apr 12 10:20:40 2005
@@ -796,7 +796,7 @@

          modified_since = self.getHeader('if-modified-since')
          if modified_since:
-            modified_since = stringToDatetime(modified_since)
+            modified_since =  
stringToDatetime(modified_since.split(';', 1)[0])
              if modified_since >= when:
                  self.setResponseCode(NOT_MODIFIED)
                  return CACHED

James




More information about the Twisted-web mailing list