diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPartFormInputStream.java b/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPartFormInputStream.java index 2494522e190..a102f4f262c 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPartFormInputStream.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPartFormInputStream.java @@ -237,7 +237,8 @@ public class MultiPartFormInputStream @Override public Collection getHeaders(String name) { - return _headers.getValues(name); + Collection headers = _headers.getValues(name); + return headers == null ? Collections.emptyList():headers; } @Override diff --git a/jetty-http/src/main/resources/org/eclipse/jetty/http/mime.properties b/jetty-http/src/main/resources/org/eclipse/jetty/http/mime.properties index b4ad431489b..fe10cfdba3d 100644 --- a/jetty-http/src/main/resources/org/eclipse/jetty/http/mime.properties +++ b/jetty-http/src/main/resources/org/eclipse/jetty/http/mime.properties @@ -167,6 +167,7 @@ ustar=application/x-ustar vcd=application/x-cdlink vrml=model/vrml vxml=application/voicexml+xml +wasm=application/wasm wav=audio/x-wav wbmp=image/vnd.wap.wbmp wml=text/vnd.wap.wml diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/MultiPartFormInputStreamTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/MultiPartFormInputStreamTest.java index 9343f82e58a..9a940f6c50d 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/MultiPartFormInputStreamTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/MultiPartFormInputStreamTest.java @@ -786,6 +786,8 @@ public class MultiPartFormInputStreamTest assertThat(stuff.getContentType(), is("text/plain")); assertThat(stuff.getHeader("Content-Type"), is("text/plain")); assertThat(stuff.getHeaders("content-type").size(), is(1)); + assertNotNull(stuff.getHeaders("non existing part")); + assertThat(stuff.getHeaders("non existing part").size(), is(0)); assertThat(stuff.getHeader("content-disposition"), is("form-data; name=\"stuff\"; filename=\"" + filename + "\"")); assertThat(stuff.getHeaderNames().size(), is(2)); assertThat(stuff.getSize(), is(51L));