diff --git a/swift/common/middleware/formpost.py b/swift/common/middleware/formpost.py index b81b75d619..ba4de7af82 100644 --- a/swift/common/middleware/formpost.py +++ b/swift/common/middleware/formpost.py @@ -242,7 +242,7 @@ def _iter_requests(wsgi_input, boundary): :returns: A generator of file-like objects for each part. """ boundary = '--' + boundary - if wsgi_input.readline().strip() != boundary: + if wsgi_input.readline(len(boundary + '\r\n')).strip() != boundary: raise FormInvalid('invalid starting boundary') boundary = '\r\n' + boundary input_buffer = ''