Skip to content

Commit

Permalink
More MediaType improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Aug 30, 2019
1 parent ffc30c2 commit 128dd20
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/main/java/io/sinistral/proteus/server/MediaType.java
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ public class MediaType
public static final MediaType IMAGE_PNG = create("image/png", "png");
public static final MediaType IMAGE_PRS_BTIF = create("image/prs.btif", "btif");
public static final MediaType IMAGE_SGI = create("image/sgi", "sgi");
public static final MediaType IMAGE_SVG_XML = createUTF8("image/svg+xml", "svg", "svgz");
public static final MediaType IMAGE_SVG_XML = create("image/svg+xml", "svg", "svgz");
public static final MediaType IMAGE_TIFF = create("image/tiff", "tiff", "tif");
public static final MediaType IMAGE_VND_ADOBE_PHOTOSHOP = create("image/vnd.adobe.photoshop", "psd");
public static final MediaType IMAGE_VND_DECE_GRAPHIC = create("image/vnd.dece.graphic", "uvi", "uvvi", "uvg",
Expand Down Expand Up @@ -1190,8 +1190,10 @@ public static synchronized MediaType create(String type, String[] attributes, St
{
MediaType mt = new MediaType(type, attributes);

for (String ext : fileExtensisons) {
FILE_EXTENSIONS.put(ext, mt);
if(!Arrays.stream(attributes).anyMatch(a -> a.equals(UTF8_ATTR[0]))) {
for (String ext : fileExtensisons) {
FILE_EXTENSIONS.put(ext, mt);
}
}

return mt;
Expand Down

0 comments on commit 128dd20

Please sign in to comment.