Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2012-12-22 01:38:28 +0000
committerJan Bartel2012-12-22 01:38:28 +0000
commitc9135e34c9bd095fd37a3602ae20470416c863ea (patch)
tree9ca2d062a70b84d535fdcedd3043cdc9af644ce7 /jetty-servlets/src/main/java/org/eclipse
parent810ff3802fafb0e3546fa6f11db45e0dfcfcc61b (diff)
downloadorg.eclipse.jetty.project-c9135e34c9bd095fd37a3602ae20470416c863ea.tar.gz
org.eclipse.jetty.project-c9135e34c9bd095fd37a3602ae20470416c863ea.tar.xz
org.eclipse.jetty.project-c9135e34c9bd095fd37a3602ae20470416c863ea.zip
397111 Allow multipart bodies with leading blank lines
Diffstat (limited to 'jetty-servlets/src/main/java/org/eclipse')
-rw-r--r--jetty-servlets/src/main/java/org/eclipse/jetty/servlets/MultiPartFilter.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/MultiPartFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/MultiPartFilter.java
index b2ac85b305..f66c7ef425 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/MultiPartFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/MultiPartFilter.java
@@ -151,7 +151,18 @@ public class MultiPartFilter implements Filter
if (line == null || line.length() == 0)
throw new IOException("Missing content for multipart request");
- if (!line.equals(boundary))
+ boolean badFormatLogged = false;
+ while (line != null && !line.equals(boundary))
+ {
+ if (!badFormatLogged)
+ {
+ LOG.warn("Badly formatted multipart request");
+ badFormatLogged = true;
+ }
+ line=((ReadLineInputStream)in).readLine();
+ }
+
+ if (line == null || line.length() == 0)
throw new IOException("Missing initial multi part boundary");
// Read each part

Back to the top