diff --git a/potassium/potassium.py b/potassium/potassium.py index 9ea0ca2..9ad355b 100644 --- a/potassium/potassium.py +++ b/potassium/potassium.py @@ -3,6 +3,7 @@ from typing import Generator, Optional, Union from flask import Flask, request, make_response, abort, Response as FlaskResponse from werkzeug.serving import make_server +from werkzeug.datastructures.headers import EnvironHeaders from threading import Thread, Lock, Condition import functools import traceback @@ -15,9 +16,8 @@ def __init__(self, type, func): self.type = type self.func = func - class Request(): - def __init__(self, id: str, headers: dict, json: dict): + def __init__(self, id: str, headers: EnvironHeaders, json: dict): self.id = id self.headers = headers self.json = json @@ -183,7 +183,7 @@ def _handle_generic(self, endpoint, flask_request): try: req = Request( - headers=dict(flask_request.headers), + headers=flask_request.headers, json=flask_request.get_json(), id=flask_request.headers.get("X-Banana-Request-Id", "") )