summaryrefslogtreecommitdiff
path: root/waitress/parser.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2014-07-13 22:58:30 -0400
committerChris McDonough <chrism@plope.com>2014-07-13 22:58:30 -0400
commita9a1aad2684c5bea10fd4db6b63491d6e5a23223 (patch)
tree7a33a7a99843e8487fa63d8136fd523a76e1b212 /waitress/parser.py
parent77698fbf35376bdd530493e5db262c256ebe87c4 (diff)
downloadwaitress-fix.issue64.tar.gz
This fixes #64 but only for Python 3; Python 2 fails the test. I'm clueless about what the right thing to do is.fix.issue64
Diffstat (limited to 'waitress/parser.py')
-rw-r--r--waitress/parser.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/waitress/parser.py b/waitress/parser.py
index dec96f6..4261fa3 100644
--- a/waitress/parser.py
+++ b/waitress/parser.py
@@ -251,7 +251,10 @@ class HTTPRequestParser(object):
def split_uri(uri):
# urlsplit handles byte input by returning bytes on py3, so
# scheme, netloc, path, query, and fragment are bytes
- scheme, netloc, path, query, fragment = urlparse.urlsplit(uri)
+ try:
+ scheme, netloc, path, query, fragment = urlparse.urlsplit(uri)
+ except UnicodeError:
+ raise ParsingError('Bad URI')
return (
tostr(scheme),
tostr(netloc),