You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally reported by: yitezhan (Bitbucket: yitezhan, GitHub: yitezhan)
wsgiserver2.py HTTPRequest's parse_request_uri() method has a bug:
If the incoming uri has the "://" mark inside but is not a valid schema, such as "/operation/sch://foo/bar", parse_request_uri() will return scheme, authority, path = ('/operation/sch', 'foo', '/bar'), which is incorrect, and so then the dispatcher fails to find the correct handler. For this case, parse_request_uri() should return (None, None, '/operation/sch://foo/bar')
The current way of deciding the scheme looks sketchy.
i=uri.find('://')
It is probably better to use urlparse to parse the uri.
Originally reported by: yitezhan (Bitbucket: yitezhan, GitHub: yitezhan)
wsgiserver2.py HTTPRequest's parse_request_uri() method has a bug:
If the incoming uri has the
"://"
mark inside but is not a valid schema, such as"/operation/sch://foo/bar"
, parse_request_uri() will returnscheme, authority, path = ('/operation/sch', 'foo', '/bar')
, which is incorrect, and so then the dispatcher fails to find the correct handler. For this case, parse_request_uri() should return(None, None, '/operation/sch://foo/bar')
The current way of deciding the scheme looks sketchy.
It is probably better to use urlparse to parse the uri.
The attached fix solves the issue and does not bring regression. I also modified wsgiserver3.py.
The text was updated successfully, but these errors were encountered: