You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2019/04/12 12:51:52 UTC
[allura] branch kt/8277 updated: fixup! [#8277] Catch url/unicode
problems in early middleware and raise 400
This is an automated email from the ASF dual-hosted git repository.
kentontaylor pushed a commit to branch kt/8277
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/kt/8277 by this push:
new 00bf7b8 fixup! [#8277] Catch url/unicode problems in early middleware and raise 400
00bf7b8 is described below
commit 00bf7b833725384be61b86bbf4aae4ff04d372fe
Author: Kenton Taylor <kt...@slashdotmedia.com>
AuthorDate: Fri Apr 12 12:51:36 2019 +0000
fixup! [#8277] Catch url/unicode problems in early middleware and raise 400
---
Allura/allura/lib/custom_middleware.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index 466c2b6..4c7c530 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -239,7 +239,7 @@ class SSLMiddleware(object):
try:
request_uri = req.url
request_uri.decode('ascii')
- except UnicodeError, UnicodeDecodeError:
+ except UnicodeError:
resp = exc.HTTPBadRequest()
secure = req.url.startswith('https://')
@@ -279,7 +279,7 @@ class SetRequestHostFromConfig(object):
try:
req.params # check for malformed unicode, this is the first middleware that might trip over it.
resp = self.app
- except UnicodeError, UnicodeDecodeError:
+ except UnicodeError:
resp = exc.HTTPBadRequest()