diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java b/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java index 46c87d00883..5b11b9c71a9 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java @@ -211,27 +211,22 @@ public class MimeTypes } else { - int count = 0; - try (InputStream in = mimeTypesUrl.openStream(); InputStreamReader reader = new InputStreamReader(in, StandardCharsets.UTF_8)) { Properties mime = new Properties(); mime.load(reader); - - for (String ext : mime.stringPropertyNames()) + mime.stringPropertyNames().stream() + .filter(x->x!=null) + .forEach(x-> + __dftMimeMap.put(StringUtil.asciiToLowerCase(x), normalizeMimeType(mime.getProperty(x)))); + + if (__dftMimeMap.size()t!=null) + .forEach(t->__encodings.put(t, encoding.getProperty(t))); - for (String type : encoding.stringPropertyNames()) + if (__encodings.size()