diff options
author | Mark Haines <mark.haines@matrix.org> | 2016-02-12 13:46:59 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2016-02-12 13:46:59 +0000 |
commit | 58c9f206929560044fccae84c36fdd89724ccfc0 (patch) | |
tree | 1fc9e3c4ba992e6c35efb68dc9a62a7fa021295a /synapse/rest/client/v2_alpha/auth.py | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-58c9f206929560044fccae84c36fdd89724ccfc0.tar.xz |
Catch the exceptions thrown by twisted when you write to a closed connection
Diffstat (limited to 'synapse/rest/client/v2_alpha/auth.py')
-rw-r--r-- | synapse/rest/client/v2_alpha/auth.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/rest/client/v2_alpha/auth.py b/synapse/rest/client/v2_alpha/auth.py index ff71c40b43..78181b7b18 100644 --- a/synapse/rest/client/v2_alpha/auth.py +++ b/synapse/rest/client/v2_alpha/auth.py @@ -18,6 +18,7 @@ from twisted.internet import defer from synapse.api.constants import LoginType from synapse.api.errors import SynapseError from synapse.api.urls import CLIENT_V2_ALPHA_PREFIX +from synapse.http.server import finish_request from synapse.http.servlet import RestServlet from ._base import client_v2_patterns @@ -130,7 +131,7 @@ class AuthRestServlet(RestServlet): request.setHeader(b"Content-Length", b"%d" % (len(html_bytes),)) request.write(html_bytes) - request.finish() + finish_request(request) defer.returnValue(None) else: raise SynapseError(404, "Unknown auth stage type") @@ -176,7 +177,7 @@ class AuthRestServlet(RestServlet): request.setHeader(b"Content-Length", b"%d" % (len(html_bytes),)) request.write(html_bytes) - request.finish() + finish_request(request) defer.returnValue(None) else: |