Skip to content

Commit a5f1bf6

Browse files
committed
quart.py: Simplify by using the send_status_code_and_text from asgi function
1 parent 596709f commit a5f1bf6

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

aikido_zen/sources/quart.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from aikido_zen.context import Context, get_current_context
2+
from .functions.asgi_middleware import send_status_code_and_text
23
from .functions.request_handler import request_handler
34
from ..helpers.get_argument import get_argument
45
from ..sinks import on_import, patch_function, before, before_async
@@ -65,23 +66,6 @@ async def _asgi_app(func, instance, args, kwargs):
6566
return await func(*args, **kwargs)
6667

6768

68-
async def send_status_code_and_text(send, pre_response):
69-
await send(
70-
{
71-
"type": "http.response.start",
72-
"status": pre_response[1],
73-
"headers": [(b"content-type", b"text/plain")],
74-
}
75-
)
76-
await send(
77-
{
78-
"type": "http.response.body",
79-
"body": pre_response[0].encode("utf-8"),
80-
"more_body": False,
81-
}
82-
)
83-
84-
8569
@on_import("quart.app", "quart")
8670
def patch(m):
8771
"""

0 commit comments

Comments
 (0)