mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-11 23:47:25 +00:00
web_config: further python2/3 unification
This commit is contained in:
parent
cc0fcdc18d
commit
4140e678f4
1 changed files with 2 additions and 8 deletions
|
@ -772,18 +772,12 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||
return self.send_error(403)
|
||||
self.path = p
|
||||
|
||||
if IS_PY2:
|
||||
ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))
|
||||
else: # Python 3
|
||||
ctype, pdict = cgi.parse_header(self.headers['content-type'])
|
||||
ctype, pdict = cgi.parse_header(self.headers['content-type'])
|
||||
|
||||
if ctype == 'multipart/form-data':
|
||||
postvars = cgi.parse_multipart(self.rfile, pdict)
|
||||
elif ctype == 'application/x-www-form-urlencoded':
|
||||
try:
|
||||
length = int(self.headers.getheader('content-length'))
|
||||
except AttributeError:
|
||||
length = int(self.headers['content-length'])
|
||||
length = int(self.headers['content-length'])
|
||||
url_str = self.rfile.read(length).decode('utf-8')
|
||||
postvars = cgi.parse_qs(url_str, keep_blank_values=1)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue