diff options
Diffstat (limited to 'helpers.py')
| -rw-r--r-- | helpers.py | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -16,7 +16,7 @@ import sys import os, re, json, math import requests from bson.objectid import ObjectId -from bottle import install, run, Bottle, static_file, response, hook, JSONPlugin, get, post, error +from bottle import install, run, Bottle, static_file, JSONPlugin, get, post, error import threading class ParryEncoder(json.JSONEncoder): @@ -31,7 +31,7 @@ install(JSONPlugin(json_dumps=lambda s: json.dumps(s, cls=ParryEncoder))) os.chdir(os.path.dirname(__file__)) from .auth import * - + def calculateHashForResource(resource : requests.Response) -> object: hashobj = hashlib.sha1() @@ -53,15 +53,6 @@ def calculateHashForFile(file, hashobj : object = None) -> object: return hashobj -@route("<path:path>", method="OPTIONS") -def options(path): - return HTTPResponse(status=204, headers={"Access-Control-Allow-Origin" : "*", "Access-Control-Allow-Methods" : "GET, POST, HEAD, PUT, PATCH, DELETE", "Access-Control-Allow-Headers" : "*"}) - -@hook("after_request") -def enable_cors(): - response.headers["Access-Control-Allow-Origin"] = "*" - response.headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, PATCH, HEAD" - @error(500) def internal_error(error): if request.json is None: |
