bigboard r7414 - trunk/bigboard/httplib2



Author: marinaz
Date: Tue Jul  1 19:02:17 2008
New Revision: 7414
URL: http://svn.gnome.org/viewvc/bigboard?rev=7414&view=rev

Log:
Handle well an empty field returned for a date in the http response.


Modified:
   trunk/bigboard/httplib2/__init__.py

Modified: trunk/bigboard/httplib2/__init__.py
==============================================================================
--- trunk/bigboard/httplib2/__init__.py	(original)
+++ trunk/bigboard/httplib2/__init__.py	Tue Jul  1 19:02:17 2008
@@ -285,7 +285,7 @@
         retval = "STALE"
     elif cc.has_key('only-if-cached'):
         retval = "FRESH"
-    elif response_headers.has_key('date'):
+    elif response_headers.has_key('date') and response_headers['date'].strip() is not "":
         date = calendar.timegm(email.Utils.parsedate_tz(response_headers['date']))
         now = time.time()
         current_age = max(0, now - date)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]