File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/main/java/org/javawebstack/http/router/util Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 55
66public class HeaderValue {
77
8- final String value ;
9- final Map <String , String > directives = new HashMap <>();
8+ private final String value ;
9+ private final Map <String , String > directives = new HashMap <>();
1010
1111 public HeaderValue (String source ) {
1212 String [] spl = source .split ("; " );
Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ public static MimeType byExtension(String extension) {
5757 }
5858
5959 public static MimeType byMimeType (String mimeType ) {
60+ if (mimeType == null )
61+ return null ;
62+ if (mimeType .contains (";" ))
63+ mimeType = new HeaderValue (mimeType ).getValue ();
6064 for (MimeType type : values ()) {
6165 if (type .mimeTypes .contains (mimeType )) {
6266 return type ;
You can’t perform that action at this time.
0 commit comments