Skip to content

Commit

Permalink
Merge branch '2.6.x' into 2.7.x
Browse files Browse the repository at this point in the history
Closes gh-29751
  • Loading branch information
wilkinsona committed Feb 11, 2022
2 parents da61545 + 4b33ea7 commit 197112e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -128,7 +128,7 @@ public final class MimeMappings implements Iterable<MimeMappings.Mapping> {
mappings.add("otg", "application/vnd.oasis.opendocument.graphics-template");
mappings.add("oth", "application/vnd.oasis.opendocument.text-web");
mappings.add("otp", "application/vnd.oasis.opendocument.presentation-template");
mappings.add("ots", "application/vnd.oasis.opendocument.spreadsheet-template ");
mappings.add("ots", "application/vnd.oasis.opendocument.spreadsheet-template");
mappings.add("ott", "application/vnd.oasis.opendocument.text-template");
mappings.add("ogx", "application/ogg");
mappings.add("ogv", "video/ogg");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,6 +20,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -135,4 +136,11 @@ void makeUnmodifiable() {
assertThat(unmodifiable.get("foo")).isNull();
}

@Test
void mimeTypesInDefaultMappingsAreCorrectlyStructured() {
String regName = "[A-Za-z0-9!#$&.+\\-^_]{1,127}";
Pattern pattern = Pattern.compile("^" + regName + "\\/" + regName + "$");
assertThat(MimeMappings.DEFAULT).allSatisfy((mapping) -> assertThat(mapping.getMimeType()).matches(pattern));
}

}

0 comments on commit 197112e

Please sign in to comment.