Bug fixes and performance improvements

This commit is contained in:
Ian Renton
2026-05-10 10:57:41 +01:00
parent 74ce486098
commit 363735a235
25 changed files with 82 additions and 66 deletions

View File

@@ -41,8 +41,7 @@ class APISpotHandler(tornado.web.RequestHandler):
return
# Reject if format not json
if 'Content-Type' not in self.request.headers or self.request.headers.get(
'Content-Type') != "application/json":
if not self.request.headers.get('Content-Type', '').startswith("application/json"):
self.set_status(415)
self.write(
json.dumps("Error - request Content-Type must be application/json", default=serialize_everything))
@@ -139,7 +138,7 @@ class APISpotHandler(tornado.web.RequestHandler):
except Exception as e:
logging.error(e)
self.write(json.dumps("Error - " + str(e), default=serialize_everything))
self.write(json.dumps("Error - an internal server error occurred.", default=serialize_everything))
self.set_status(500)
self.set_header("Cache-Control", "no-store")
self.set_header("Content-Type", "application/json")