We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 939065e commit 3839de6Copy full SHA for 3839de6
2 files changed
src/main/java/org/javawebstack/http/router/util/HeaderValue.java
@@ -5,8 +5,8 @@
5
6
public class HeaderValue {
7
8
- final String value;
9
- final Map<String, String> directives = new HashMap<>();
+ private final String value;
+ private final Map<String, String> directives = new HashMap<>();
10
11
public HeaderValue(String source) {
12
String[] spl = source.split("; ");
src/main/java/org/javawebstack/http/router/util/MimeType.java
@@ -57,6 +57,10 @@ public static MimeType byExtension(String extension) {
57
}
58
59
public static MimeType byMimeType(String mimeType) {
60
+ if(mimeType == null)
61
+ return null;
62
+ if(mimeType.contains(";"))
63
+ mimeType = new HeaderValue(mimeType).getValue();
64
for (MimeType type : values()) {
65
if (type.mimeTypes.contains(mimeType)) {
66
return type;
0 commit comments