summary refs log tree commit diff
path: root/synapse/http/server.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-22 18:33:37 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-22 18:33:37 +0100
commit3518cc79b61c47f7406317ccf95f422fe9b592a9 (patch)
tree1d61c75439f195f9ec327762b2909a2458321215 /synapse/http/server.py
parentMerge commit 'e19396d62' into anoa/dinsic_release_1_31_0 (diff)
parentFix SSO on workers (#9271) (diff)
downloadsynapse-3518cc79b61c47f7406317ccf95f422fe9b592a9.tar.xz
Merge commit '9c715a5f1' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'synapse/http/server.py')
-rw-r--r--synapse/http/server.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py

index d69d579b3a..8249732b27 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py
@@ -761,6 +761,13 @@ def set_clickjacking_protection_headers(request: Request): request.setHeader(b"Content-Security-Policy", b"frame-ancestors 'none';") +def respond_with_redirect(request: Request, url: bytes) -> None: + """Write a 302 response to the request, if it is still alive.""" + logger.debug("Redirect to %s", url.decode("utf-8")) + request.redirect(url) + finish_request(request) + + def finish_request(request: Request): """ Finish writing the response to the request.