1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-29 16:55:32 +00:00

Extract httputils.redirect

This commit is contained in:
Unrud 2022-01-18 18:20:15 +01:00
parent 113eeec847
commit 9e9f2bb780
4 changed files with 10 additions and 12 deletions

View file

@ -114,3 +114,9 @@ def read_request_body(configuration: "config.Configuration",
read_raw_request_body(configuration, environ))
logger.debug("Request content:\n%s", content)
return content
def redirect(location: str, status: int = client.FOUND) -> types.WSGIResponse:
return (status,
{"Location": location, "Content-Type": "text/plain"},
"Redirected to %s" % location)