Add redirect helper on python ServerSentEventGenerator (#836)

This commit is contained in:
Chase Sterling 2025-04-14 12:33:12 -04:00 committed by GitHub
parent a4145207f0
commit a705eb7044
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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}')")