Fix a bug where we did unnecessary parsing.

This commit is contained in:
Itamar Turner-Trauring 2022-01-06 13:09:25 -05:00
parent 2f94fdf372
commit 9f5d7c6d22

View File

@ -114,7 +114,8 @@ class TahoeLAFSRequest(Request, object):
self.path, argstring = x
self.args = parse_qs(argstring, 1)
if self.method == b'POST':
content_type = (self.requestHeaders.getRawHeaders("content-type") or [""])[0]
if self.method == b'POST' and content_type.split(";")[0] == "multipart/form-data":
# We use FieldStorage here because it performs better than
# cgi.parse_multipart(self.content, pdict) which is what
# twisted.web.http.Request uses.