From 31aee8a938be96aac6db43fb7e0c2911b2e3beca Mon Sep 17 00:00:00 2001 From: amvanbaren Date: Fri, 16 Dec 2022 22:15:57 +0200 Subject: [PATCH] Prepend dot(.) if extension doesn't start with a dot. --- .../src/main/java/org/eclipse/openvsx/ExtensionProcessor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java b/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java index 358f1677b..a727a0fa5 100644 --- a/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java +++ b/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java @@ -448,6 +448,10 @@ private Map parseContentTypesXml(byte[] content) { var element = elements.item(i); var attributes = element.getAttributes(); var extension = attributes.getNamedItem("Extension").getTextContent(); + if(!extension.startsWith(".")) { + extension = "." + extension; + } + var contentType = attributes.getNamedItem("ContentType").getTextContent(); contentTypes.put(extension, contentType); }