From 3d91037bacf2c0892ddf698c4d4646f717510c03 Mon Sep 17 00:00:00 2001 From: nggit Date: Sun, 30 Mar 2025 11:33:05 +0700 Subject: [PATCH] standarize --- httpout/response.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/httpout/response.py b/httpout/response.py index 381b1e7..24aef5e 100644 --- a/httpout/response.py +++ b/httpout/response.py @@ -87,12 +87,12 @@ async def callback(): self.loop.call_soon_threadsafe(self.create_task, callback()) return fut - def call_soon(self, func, *args): + def call_soon(self, func, *args, **kwargs): try: loop = asyncio.get_running_loop() if loop is self.loop: - return func(*args) + return func(*args, **kwargs) except RuntimeError: pass @@ -100,7 +100,7 @@ def call_soon(self, func, *args): def callback(): try: - result = func(*args) + result = func(*args, **kwargs) if not fut.done(): fut.set_result(result) @@ -120,11 +120,11 @@ def append_header(self, name, value): def set_header(self, name, value=''): self.call_soon(self.response.set_header, name, value) - def set_cookie(self, name, value='', expires=0, path='/', domain=None, + def set_cookie(self, name, value='', *, expires=0, path='/', domain=None, secure=False, httponly=False, samesite=None): self.call_soon( - self.response.set_cookie, name, value, expires, path, domain, - secure, httponly, samesite + self.response.set_cookie, name, value, expires=expires, path=path, + domain=domain, secure=secure, httponly=httponly, samesite=samesite ) def set_status(self, status=200, message='OK'):