Subject: | Upload of multiple files can fail because headers become broken |
There is a bug in the current mechanism for handling file uploads. If there are multiple files being uploaded and the buffer ends in the middle of the headers of one of the files, the boundary is silently disposed of and the contents of the second file (headers included) are appended to the contents of the previous file.
The mechanism for detecting the combination of the boundary and the headers needs to be changed to account for the possibility that the headers straddle the buffer endpoint.