summaryrefslogtreecommitdiff
path: root/src/leap/util/request_helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/util/request_helpers.py')
-rw-r--r--src/leap/util/request_helpers.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/leap/util/request_helpers.py b/src/leap/util/request_helpers.py
index c5d0f3f5..019ff353 100644
--- a/src/leap/util/request_helpers.py
+++ b/src/leap/util/request_helpers.py
@@ -19,6 +19,8 @@
Request helpers for backward compatible "parsing" of requests
"""
+import time
+
import json
from dateutil import parser as dateparser
@@ -50,6 +52,7 @@ def get_content(request):
mtime = None
last_modified = request.headers.get('last-modified', None)
if last_modified:
- mtime = int(dateparser.parse(last_modified).strftime("%s"))
+ dt = dateparser.parse(unicode(last_modified))
+ mtime = int(time.mktime(dt.timetuple()) + dt.microsecond / 1000000.0)
return contents, mtime