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

Method redirect

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

Source from the content-addressed store, hash-verified

252 """Client follows redirect."""
253
254 def redirect(connection, request):
255 if request.path == "/redirect":
256 response = connection.respond(http.HTTPStatus.FOUND, "")
257 response.headers["Location"] = "/"
258 return response
259
260 async with serve(*args, process_request=redirect) as server:
261 async with connect(get_uri(server) + "/redirect") as client:

Callers

nothing calls this directly

Calls 2

get_uriFunction · 0.70
respondMethod · 0.45

Tested by

no test coverage detected