Skip to content

Commit

Permalink
Support mp4 and mp3
Browse files Browse the repository at this point in the history
  • Loading branch information
dgageot committed May 7, 2015
1 parent cf76d1a commit f78769e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/net/codestory/http/types/ContentTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public static String get(String filename) {
return "application/x-font-woff";
case ".ico":
return "image/x-icon";
case ".mp4":
return "video/mp4";
case ".mp3":
return "audio/mpeg";
default:
return "text/plain;charset=UTF-8";
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/net/codestory/http/types/ContentTypesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public void content_type_from_extension() {
assertThat(get("script.coffee")).isEqualTo("application/javascript;charset=UTF-8");
assertThat(get("script.litcoffee")).isEqualTo("application/javascript;charset=UTF-8");
assertThat(get("favicon.ico")).isEqualTo("image/x-icon");
assertThat(get("video.mp4")).isEqualTo("video/mp4");
assertThat(get("video.mp3")).isEqualTo("audio/mpeg");
assertThat(get("unknown")).isEqualTo("text/plain;charset=UTF-8");
}
}

0 comments on commit f78769e

Please sign in to comment.