avoid_etag_error

pull/17/head
db0 2023-07-07 10:14:56 +02:00
parent 1d511f3dc6
commit 3cf4ebc797
1 changed files with 4 additions and 1 deletions

View File

@ -19,6 +19,9 @@ def after_request(response):
response.headers["Access-Control-Allow-Methods"] = "POST, GET, OPTIONS, PUT, DELETE, PATCH" response.headers["Access-Control-Allow-Methods"] = "POST, GET, OPTIONS, PUT, DELETE, PATCH"
response.headers["Access-Control-Allow-Headers"] = "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, apikey, Client-Agent, X-Fields" response.headers["Access-Control-Allow-Headers"] = "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, apikey, Client-Agent, X-Fields"
response.headers["Fediseer-Node"] = f"{socket.gethostname()}:{args.port}:{FEDISEER_VERSION}" response.headers["Fediseer-Node"] = f"{socket.gethostname()}:{args.port}:{FEDISEER_VERSION}"
etag = hashlib.sha1(response.get_data()).hexdigest() try:
etag = hashlib.sha1(response.get_data()).hexdigest()
except RuntimeError:
etag = "Runtime Error"
response.headers["ETag"] = etag response.headers["ETag"] = etag
return response return response