diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartInputStream.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartInputStream.java index 00ceb5d5754..40f7ac679ee 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartInputStream.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartInputStream.java @@ -170,7 +170,9 @@ public class MultiPartInputStream */ public String getHeader(String name) { - return (String)_headers.getValue(name, 0); + if (name == null) + return null; + return (String)_headers.getValue(name.toLowerCase(), 0); } /** diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/MultiPartInputStreamTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/MultiPartInputStreamTest.java index 826dbcb1bba..6c01b7d6310 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/MultiPartInputStreamTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/MultiPartInputStreamTest.java @@ -147,7 +147,7 @@ public class MultiPartInputStreamTest extends TestCase Part stuff = mpis.getPart("stuff"); assertEquals("text/plain", stuff.getContentType()); - assertEquals("text/plain", stuff.getHeader("content-type")); + assertEquals("text/plain", stuff.getHeader("Content-Type")); assertEquals(1, stuff.getHeaders("content-type").size()); assertEquals("form-data; name=\"stuff\"; filename=\"stuff.txt\"", stuff.getHeader("content-disposition")); assertEquals(2, stuff.getHeaderNames().size());