Skip to content

Commit

Permalink
fix: add default receive and send parameter values for HTMXRequest (#…
Browse files Browse the repository at this point in the history
…2145)

fix: add default receive and send parameter values
  • Loading branch information
tompin82 authored Aug 12, 2023
1 parent 53af5fb commit 48e0f07
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion litestar/contrib/htmx/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from urllib.parse import unquote, urlsplit, urlunsplit

from litestar import Request
from litestar.connection.base import empty_receive, empty_send
from litestar.contrib.htmx._utils import HTMXHeaders
from litestar.exceptions import SerializationException
from litestar.serialization import decode_json
Expand Down Expand Up @@ -106,7 +107,7 @@ class HTMXRequest(Request):

__slots__ = ("htmx",)

def __init__(self, scope: Scope, receive: Receive, send: Send) -> None:
def __init__(self, scope: Scope, receive: Receive = empty_receive, send: Send = empty_send) -> None:
"""Initialize :class:`HTMXRequest`"""
super().__init__(scope=scope, receive=receive, send=send)
self.htmx = HTMXDetails(self)

0 comments on commit 48e0f07

Please sign in to comment.