Issue 10485: http.server fails when query string contains addition '?' characters (original) (raw)
http.server on Python 3 and CGIHTTPServer on Python 2 both contain the same code with the same bug. In run_cgi, rest.rfind('?') is used to separate the path from the query string. However, it should be rest.find('?') as the query string starts with '?' but may also contain '?'. It is required that '?' not be used in URL path part without escaping.
Apache, for example, separates the following URL:
/testing?foo=bar?&baz=3
into path part /testing and query string part foo=bar?&baz=3 but http.server does not.