MCPcopy Create free account
hub / github.com/Vinyzu/Botright / set_redirect

Method set_redirect

tests/server.py:188–194  ·  view source on GitHub ↗
(self, from_: str, to: str)

Source from the content-addressed store, hash-verified

186 self.gzip_routes.add(path)
187
188 def set_redirect(self, from_: str, to: str) -> None:
189 def handle_redirect(request: http.Request) -> None:
190 request.setResponseCode(HTTPStatus.FOUND)
191 request.setHeader("location", to)
192 request.finish()
193
194 self.set_route(from_, handle_redirect)
195
196
197class HTTPServer(Server):

Callers

nothing calls this directly

Calls 1

set_routeMethod · 0.95

Tested by

no test coverage detected