diff -r 19464d77ec2e Lib/test/test_wsgiref.py --- a/Lib/test/test_wsgiref.py Sun Dec 29 23:38:55 2013 +0000 +++ b/Lib/test/test_wsgiref.py Sun May 11 13:34:29 2014 +0200 @@ -123,6 +123,12 @@ # the middleware doesn't support len(), so content-length isn't there self.check_hello(out, has_length=False) + def test_absolute_path(self): + out, err = run_amock( + app=validator(hello_app), + data=b'GET http://127.0.0.1:8888/ HTTP/1.0\n\n') + self.check_hello(out, has_length=False) + def test_simple_validation_error(self): def bad_app(environ,start_response): start_response("200 OK", ('Content-Type','text/plain')) diff -r 19464d77ec2e Lib/wsgiref/simple_server.py --- a/Lib/wsgiref/simple_server.py Sun Dec 29 23:38:55 2013 +0000 +++ b/Lib/wsgiref/simple_server.py Sun May 11 13:34:29 2014 +0200 @@ -82,6 +82,10 @@ else: path,query = self.path,'' + # bug 21472: WSGI PATH_INFO need to be relative and BaseHTTPRequestHandler + # doesn't guarantee it to be that way. + path = urllib.parse.urlparse(path).path + env['PATH_INFO'] = urllib.parse.unquote_to_bytes(path).decode('iso-8859-1') env['QUERY_STRING'] = query