Skip to content

Commit 01f8f6c

Browse files
committed
Fix sanic bug with collections of events
1 parent 921cf32 commit 01f8f6c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/datastar_py/sanic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def __init__(
3030
) -> None:
3131
if not content:
3232
status = status or 204
33+
elif not isinstance(content, str):
34+
# Collections of events just get concatenated
35+
content = "".join(content)
3336
super().__init__(
3437
content, status=status or 200, headers={**self.default_headers, **(headers or {})}
3538
)

0 commit comments

Comments
 (0)