Add redirect helper on python ServerSentEventGenerator

This commit is contained in:
Chase Sterling 2025-04-13 22:53:34 -04:00
parent a4145207f0
commit 1ada0ebf9d
1 changed files with 4 additions and 0 deletions

View File

@ -161,3 +161,7 @@ class ServerSentEventGenerator:
event_id,
retry_duration,
)
@classmethod
def redirect(cls, location: str):
return cls.execute_script(f"setTimeout(() => window.location = '{location}')")