Skip to content

Commit 3df8498

Browse files
authored
standarize (#73)
1 parent 8c82198 commit 3df8498

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

httpout/response.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,20 @@ async def callback():
8787
self.loop.call_soon_threadsafe(self.create_task, callback())
8888
return fut
8989

90-
def call_soon(self, func, *args):
90+
def call_soon(self, func, *args, **kwargs):
9191
try:
9292
loop = asyncio.get_running_loop()
9393

9494
if loop is self.loop:
95-
return func(*args)
95+
return func(*args, **kwargs)
9696
except RuntimeError:
9797
pass
9898

9999
fut = concurrent.futures.Future()
100100

101101
def callback():
102102
try:
103-
result = func(*args)
103+
result = func(*args, **kwargs)
104104

105105
if not fut.done():
106106
fut.set_result(result)
@@ -120,11 +120,11 @@ def append_header(self, name, value):
120120
def set_header(self, name, value=''):
121121
self.call_soon(self.response.set_header, name, value)
122122

123-
def set_cookie(self, name, value='', expires=0, path='/', domain=None,
123+
def set_cookie(self, name, value='', *, expires=0, path='/', domain=None,
124124
secure=False, httponly=False, samesite=None):
125125
self.call_soon(
126-
self.response.set_cookie, name, value, expires, path, domain,
127-
secure, httponly, samesite
126+
self.response.set_cookie, name, value, expires=expires, path=path,
127+
domain=domain, secure=secure, httponly=httponly, samesite=samesite
128128
)
129129

130130
def set_status(self, status=200, message='OK'):

0 commit comments

Comments
 (0)