cpython/Lib/http
Siwon Kang 91daa9d722 bpo-38863: Improve is_cgi() in http.server (GH-17312)
is_cgi() function of http.server library does not currently handle a
cgi script if one of the cgi_directories is located at the
sub-directory of given path. Since is_cgi() in CGIHTTPRequestHandler
class separates given path into (dir, rest) based on the first seen
'/', multi-level directories like /sub/dir/cgi-bin/hello.py is divided
into head=/sub, rest=dir/cgi-bin/hello.py then check whether '/sub'
exists in cgi_directories = [..., '/sub/dir/cgi-bin'].
This patch makes the is_cgi() keep expanding dir part to the next '/'
then checking if that expanded path exists in the cgi_directories.

Signed-off-by: Siwon Kang <kkangshawn@gmail.com>





https://bugs.python.org/issue38863
2019-11-22 01:13:05 -08:00
..
__init__.py bpo-26589: Add http status code 451 (GH-15413) 2019-08-23 10:19:15 -07:00
client.py bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior (GH-16448) 2019-09-28 08:32:01 -04:00
cookiejar.py bpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies (GH-13921) 2019-09-13 04:29:00 -07:00
cookies.py bpo-991266: Fix quoting of Comment attribute of SimpleCookie (GH-6555) 2018-04-23 02:48:11 +03:00
server.py bpo-38863: Improve is_cgi() in http.server (GH-17312) 2019-11-22 01:13:05 -08:00