aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/rest_api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/rest_api.py b/modules/rest_api.py
index 74575ff4..ca1ee79f 100644
--- a/modules/rest_api.py
+++ b/modules/rest_api.py
@@ -14,6 +14,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
_, _, endpoint = path[1:].partition("/")
endpoint, _, args = endpoint.partition("/")
args = list(filter(None, args.split("/")))
+ headers = {key.title(): value for key, value in self.headers}
response = ""
code = 404
@@ -33,7 +34,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
event_response = _bot.trigger(lambda:
_events.on("api").on(method).on(
endpoint).call_unsafe_for_result(params=params,
- path=args, data=data, headers=dict(self.headers)))
+ path=args, data=data, headers=headers))
except Exception as e:
_log.error("failed to call API endpoint \"%s\"",
[path], exc_info=True)