Fixed issue #58 - malformed cache-control headers would cause an exception
diff --git a/httplib2test.py b/httplib2test.py
index a0b4dc5..7fc0110 100755
--- a/httplib2test.py
+++ b/httplib2test.py
@@ -984,6 +984,12 @@
cc = httplib2._parse_cache_control({'cache-control': ' , '})
self.assertEqual(cc[''], 1)
+ try:
+ cc = httplib2._parse_cache_control({'cache-control': 'Max-age=3600;post-check=1800,pre-check=3600'})
+ self.assertTrue("max-age" in cc)
+ except:
+ self.fail("Should not throw exception")
+
def testNormalizeHeaders(self):
# Test that we normalize headers to lowercase
h = httplib2._normalize_headers({'Cache-Control': 'no-cache', 'Other': 'Stuff'})