Skip to content
Snippets Groups Projects
Commit 0ad44acb authored by David Baker's avatar David Baker Committed by GitHub
Browse files

Merge pull request #1997 from matrix-org/dbkr/cas_partialdownload

Handle PartialDownloadError in CAS login
parents 5f14e7e9 1ece0627
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,8 @@ from saml2.client import Saml2Client
import xml.etree.ElementTree as ET
from twisted.web.client import PartialDownloadError
logger = logging.getLogger(__name__)
......@@ -417,7 +419,12 @@ class CasTicketServlet(ClientV1RestServlet):
"ticket": request.args["ticket"],
"service": self.cas_service_url
}
body = yield http_client.get_raw(uri, args)
try:
body = yield http_client.get_raw(uri, args)
except PartialDownloadError as pde:
# Twisted raises this error if the connection is closed,
# even if that's being used old-http style to signal end-of-data
body = pde.response
result = yield self.handle_cas_response(request, body, client_redirect_url)
defer.returnValue(result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment