Skip to content

Commit 5618f17

Browse files
ZexbeJoshua Nelson
authored and
Joshua Nelson
committed
Changed x-toml mime to toml
1 parent 07272ba commit 5618f17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/db/file.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ fn detect_mime(_content: &Vec<u8>, file_path: &Path) -> Result<String> {
281281

282282
fn correct_mime(mime: &str, file_path: &Path) -> Result<String> {
283283
Ok(match mime {
284-
"text/plain" | "text/troff" | "text/x-markdown" | "text/x-rust" => {
284+
"text/plain" | "text/troff" | "text/x-markdown" | "text/x-rust" | "text/x-toml" => {
285285
match file_path.extension().and_then(OsStr::to_str) {
286286
Some("md") => "text/markdown",
287287
Some("rs") => "text/rust",
288288
Some("markdown") => "text/markdown",
289289
Some("css") => "text/css",
290-
Some("toml") => "text/x-toml",
290+
Some("toml") => "text/toml",
291291
Some("js") => "application/javascript",
292292
Some("json") => "application/json",
293293
_ => mime
@@ -379,7 +379,7 @@ mod test {
379379
#[test]
380380
fn test_mime_types() {
381381
check_mime("/ignored", ".gitignore", "text/plain");
382-
check_mime("[package]", "hello.toml","text/x-toml");
382+
check_mime("[package]", "hello.toml","text/toml");
383383
check_mime(".ok { color:red; }", "hello.css","text/css");
384384
check_mime("var x = 1", "hello.js","application/javascript");
385385
check_mime("<html>", "hello.html","text/html");

0 commit comments

Comments
 (0)