5945N/A# This issue has been offered to upstream and merged.
5945N/A# Please see https://bitbucket.org/cherrypy/cherrypy/commits/89dbd2f00b541f8f8378eaabf2caef3e932bb805
5945N/A# HG changeset patch
5945N/A# User Yiteng Zhang <yiteng.zhang@oracle.com>
5945N/A# Date 1461887965 25200
5945N/A# Node ID 89dbd2f00b541f8f8378eaabf2caef3e932bb805
5945N/A# Parent ea07b29deabd28d5a10b764a1a452c876692d028
5945N/Aparse_request_uri() incorrectly parses URI which contains ://
5107N/A
5945N/A--- cherrypy/wsgiserver/wsgiserver2.py
5945N/A+++ cherrypy/wsgiserver/wsgiserver2.py
5945N/A@@ -92,6 +92,7 @@
5945N/A import traceback as traceback_
5107N/A import operator
5107N/A from urllib import unquote
5107N/A+from urlparse import urlparse
5107N/A import warnings
5945N/A import errno
5945N/A import logging
5945N/A@@ -830,15 +831,12 @@
5107N/A if uri == ASTERISK:
5107N/A return None, None, uri
5107N/A
5107N/A- i = uri.find('://')
5107N/A- if i > 0 and QUESTION_MARK not in uri[:i]:
5107N/A+ scheme, authority, path, params, query, fragment = urlparse(uri)
5107N/A+ if scheme and QUESTION_MARK not in scheme:
5107N/A # An absoluteURI.
5107N/A # If there's a scheme (and it must be http or https), then:
5107N/A # http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query
5107N/A # ]]
5107N/A- scheme, remainder = uri[:i].lower(), uri[i + 3:]
5107N/A- authority, path = remainder.split(FORWARD_SLASH, 1)
5107N/A- path = FORWARD_SLASH + path
5107N/A return scheme, authority, path
5107N/A
5107N/A if uri.startswith(FORWARD_SLASH):
5945N/A--- cherrypy/wsgiserver/wsgiserver3.py
5945N/A+++ cherrypy/wsgiserver/wsgiserver3.py
5945N/A@@ -92,6 +92,8 @@
5945N/A import traceback as traceback_
5945N/A import errno
5945N/A import logging
5107N/A+from urllib.parse import urlparse
5945N/A+
5945N/A try:
5945N/A # prefer slower Python-based io module
5945N/A import _pyio as io
5945N/A@@ -819,14 +821,13 @@
5107N/A if uri == ASTERISK:
5107N/A return None, None, uri
5107N/A
5107N/A- scheme, sep, remainder = uri.partition(b'://')
5107N/A- if sep and QUESTION_MARK not in scheme:
5107N/A+ scheme, authority, path, params, query, fragment = urlparse(uri)
5107N/A+ if scheme and QUESTION_MARK not in scheme:
5107N/A # An absoluteURI.
5107N/A # If there's a scheme (and it must be http or https), then:
5107N/A # http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query
5107N/A # ]]
5107N/A- authority, path_a, path_b = remainder.partition(FORWARD_SLASH)
5107N/A- return scheme.lower(), authority, path_a + path_b
5107N/A+ return scheme, authority, path
5107N/A
5107N/A if uri.startswith(FORWARD_SLASH):
5107N/A # An abs_path.