MCPcopy Index your code
hub / github.com/python-websockets/websockets / redirect

Method redirect

tests/asyncio/test_client.py:872–875  ·  view source on GitHub ↗
(connection, request)

Source from the content-addressed store, hash-verified

870 """Client doesn't follows redirect to a URI on a different origin."""
871
872 def redirect(connection, request):
873 response = connection.respond(http.HTTPStatus.FOUND, "")
874 response.headers["Location"] = "ws://other/"
875 return response
876
877 with temp_unix_socket_path() as path:
878 async with unix_serve(handler, path, process_request=redirect):

Callers

nothing calls this directly

Calls 1

respondMethod · 0.45

Tested by

no test coverage detected