summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorSiwon Kang <kkangshawn@gmail.com>2019-11-22 09:13:05 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-11-22 09:13:05 (GMT)
commit91daa9d7224626dad4bb820924c01b3438ca6e3f (patch)
tree7e44a82b5e6093fbe2fa6a4ad890047d52027371 /Misc
parentb4e5eeac267c436bb60776dc5be771d3259bd298 (diff)
downloadcpython-91daa9d7224626dad4bb820924c01b3438ca6e3f.zip
cpython-91daa9d7224626dad4bb820924c01b3438ca6e3f.tar.gz
cpython-91daa9d7224626dad4bb820924c01b3438ca6e3f.tar.bz2
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
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2019-11-21-16-30-00.bpo-38863.RkdTjf.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-11-21-16-30-00.bpo-38863.RkdTjf.rst b/Misc/NEWS.d/next/Library/2019-11-21-16-30-00.bpo-38863.RkdTjf.rst
new file mode 100644
index 0000000..6b621ee
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-11-21-16-30-00.bpo-38863.RkdTjf.rst
@@ -0,0 +1,2 @@
+Improve :func:`is_cgi` function in :mod:`http.server`, which enables processing
+the case that cgi directory is a child of another directory other than root.