multipart boundary max-len

This commit is contained in:
ed 2026-07-30 18:22:45 +00:00
parent 398fcf1d18
commit 4003a47723

View file

@ -2150,7 +2150,8 @@ class MultipartParser(object):
boundary = get_boundary(self.headers) boundary = get_boundary(self.headers)
if boundary.startswith('"') and boundary.endswith('"'): if boundary.startswith('"') and boundary.endswith('"'):
boundary = boundary[1:-1] # dillo uses quotes boundary = boundary[1:-1] # dillo uses quotes
self.log("boundary=%r" % (boundary,)) if len(boundary) > 72: # rfc-2046 <=70
raise Pebkac(400, "boundary 2big: %d" % (len(boundary),))
# spec says there might be junk before the first boundary, # spec says there might be junk before the first boundary,
# can't have the leading \r\n if that's not the case # can't have the leading \r\n if that's not the case