webconfig: Error out on form-data

Just in case this happens anywhere return a sensible error instead of
mishandling it.
This commit is contained in:
Fabian Homborg 2021-01-03 15:27:46 +01:00
parent cb3ee51e08
commit 17501bcc57

View File

@ -1328,6 +1328,10 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
length = int(self.headers["content-length"])
url_str = self.rfile.read(length).decode("utf-8")
postvars = json.loads(url_str)
elif ctype == "multipart/form-data":
# This used to be a thing, as far as I could find there's
# no use anymore, but let's keep an error around just in case.
return self.send_error(500)
else:
postvars = {}