[Bug 397111] Tolerate empty or excessive whitespace preceeding MultiParts

This commit is contained in:
Jesse McConnell 2012-12-31 15:57:28 -03:00
commit c1e5b0b80c
1 changed files with 2 additions and 3 deletions

View File

@ -482,7 +482,7 @@ public class MultiPartInputStream
// Get first boundary // Get first boundary
String line=((ReadLineInputStream)_in).readLine(); String line=((ReadLineInputStream)_in).readLine();
if (line == null || line.length() == 0) if (line == null)
throw new IOException("Missing content for multipart request"); throw new IOException("Missing content for multipart request");
boolean badFormatLogged = false; boolean badFormatLogged = false;
@ -498,10 +498,9 @@ public class MultiPartInputStream
line=(line==null?line:line.trim()); line=(line==null?line:line.trim());
} }
if (line == null || line.length() == 0) if (line == null)
throw new IOException("Missing initial multi part boundary"); throw new IOException("Missing initial multi part boundary");
// Read each part // Read each part
boolean lastPart=false; boolean lastPart=false;
String contentDisposition=null; String contentDisposition=null;