Use ast parser to parse ETag, also in db.py.

This commit is contained in:
Michael Herzberg 2019-05-15 22:47:44 +01:00
parent 15f478ee78
commit 67d14bb7fb
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import glob
import datetime
import hashlib
from jsmin import jsmin
import ast
def get_etag(ext_id, datepath, con):
@ -48,7 +49,7 @@ def get_etag(ext_id, datepath, con):
with open(headerpath) as f:
content = f.read()
try:
headers = eval(content)
headers = ast.literal_eval(content)
if "ETag" in headers:
return headers["ETag"]
except Exception: