summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2017-08-22 13:30:09 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2017-09-27 12:28:43 (GMT)
commit850a192bcb393e74ea6842ad2d04e2f3997353e8 (patch)
treea9048bd6e448202761e023ae269c86e3066235d0
parent646132c661af7269def3c76a8ee3bc43854429cd (diff)
downloaddjango-mellon-850a192bcb393e74ea6842ad2d04e2f3997353e8.zip
django-mellon-850a192bcb393e74ea6842ad2d04e2f3997353e8.tar.gz
django-mellon-850a192bcb393e74ea6842ad2d04e2f3997353e8.tar.bz2
add a timeout to artifact resolve HTTP calls (fixes #18098)
-rw-r--r--mellon/app_settings.py1
-rw-r--r--mellon/views.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/mellon/app_settings.py b/mellon/app_settings.py
index a84f8c5..aeeab73 100644
--- a/mellon/app_settings.py
+++ b/mellon/app_settings.py
@@ -35,6 +35,7 @@ class AppSettings(object):
'TRANSIENT_FEDERATION_ATTRIBUTE': None,
'LOGIN_URL': 'mellon_login',
'LOGOUT_URL': 'mellon_logout',
+ 'ARTIFACT_RESOLVE_TIMEOUT': 10.0,
}
@property
diff --git a/mellon/views.py b/mellon/views.py
index 40fd2bf..e7dc04c 100644
--- a/mellon/views.py
+++ b/mellon/views.py
@@ -260,6 +260,7 @@ class LoginView(ProfileMixin, LogMixin, View):
try:
result = requests.post(login.msgUrl, data=login.msgBody,
headers={'content-type': 'text/xml'},
+ timeout=app_settings.ARTIFACT_RESOLVE_TIMEOUT,
verify=verify_ssl_certificate)
except RequestException, e:
self.log.warning('unable to reach %r: %s', login.msgUrl, e)