summaryrefslogtreecommitdiffstats
path: root/Lib/http/server.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2020-12-05 13:26:24 (GMT)
committerGitHub <noreply@github.com>2020-12-05 13:26:24 (GMT)
commitda3d2abe6be9fcf18cac12ec5d7d9f1180d94b5e (patch)
tree20e9e1dcf25c25fcfc998cae6f0b6f2049749edb /Lib/http/server.py
parent556d97f473fa538cef780f84bd29239ecf57d9c5 (diff)
downloadcpython-da3d2abe6be9fcf18cac12ec5d7d9f1180d94b5e.zip
cpython-da3d2abe6be9fcf18cac12ec5d7d9f1180d94b5e.tar.gz
cpython-da3d2abe6be9fcf18cac12ec5d7d9f1180d94b5e.tar.bz2
GH-5054: CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed (#23638)
Diffstat (limited to 'Lib/http/server.py')
-rw-r--r--Lib/http/server.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py
index c611381..94f730e 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -1122,12 +1122,7 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
referer = self.headers.get('referer')
if referer:
env['HTTP_REFERER'] = referer
- accept = []
- for line in self.headers.getallmatchingheaders('accept'):
- if line[:1] in "\t\n\r ":
- accept.append(line.strip())
- else:
- accept = accept + line[7:].split(',')
+ accept = self.headers.get_all('accept', ())
env['HTTP_ACCEPT'] = ','.join(accept)
ua = self.headers.get('user-agent')
if ua: