Bug 1409688 - default page header last modified to none if not available; r?jmaher draft
authorRob Wood <rwood@mozilla.com>
Tue, 24 Oct 2017 10:58:05 -0400
changeset 685461 f4b309cf7236e714c7ba45d0ec9451b23c9f4bcd
parent 685460 69d0650dfbe945e0b44d28efafdd483d1ef4e738
child 737139 78d83c275eaa9df35e12f214ff1fea5076735a66
push id85920
push userrwood@mozilla.com
push dateTue, 24 Oct 2017 15:12:47 +0000
reviewersjmaher
bugs1409688
milestone58.0a1
Bug 1409688 - default page header last modified to none if not available; r?jmaher MozReview-Commit-ID: CkiFui6Ilap
testing/talos/talos/heavy.py
--- a/testing/talos/talos/heavy.py
+++ b/testing/talos/talos/heavy.py
@@ -52,18 +52,20 @@ def follow_redirects(url, max=3):
     current = 0
     page = requests.head(url)
     while page.status_code == 303 and current < max:
         current += 1
         location = page.headers['Location']
         page = requests.head(location)
     if page.status_code == 303 and current == max:
         raise ValueError("Max redirects Reached")
-    last_modified = page.headers['Last-Modified']
-    last_modified = datetime.datetime(*parsedate(last_modified)[:6])
+
+    last_modified = page.headers.get('Last-Modified', None)
+    if last_modified is not None:
+        last_modified = datetime.datetime(*parsedate(last_modified)[:6])
     return location, last_modified
 
 
 def _recursive_mtime(path):
     max = os.path.getmtime(path)
     for root, dirs, files in os.walk(path):
         for element in dirs + files:
             age = os.path.getmtime(os.path.join(root, element))