Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit eff37df

Browse files
committed
fixed mediatypes
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
1 parent d2009e3 commit eff37df

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

mediatype.gr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import Option from "option"
44
import Map from "map"
55
import {lastIndexOf, reverse} from "./stringutil"
66

7-
let default_mt = "application/octet-stream"
7+
export let default_mt = "application/octet-stream"
8+
89
let mut mediatypes = Map.make()
910

1011
// Text formats

tests.gr

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import Env from "./env"
2-
import Util from "./stringutil"
31
import String from "string"
42
import Process from "sys/process"
53
import File from "sys/file"
4+
import Env from "./env"
5+
import Util from "./stringutil"
6+
import Mediatype from "./mediatype"
67

78
let mut totalErr = 0
89

@@ -36,5 +37,7 @@ expect(("a", "b"), Env.splitEnvVar("a=b"), "Env.splitEnvVar should parse")
3637
expect("gfedcba", Util.reverse("abcdefg"), "Util.reverse should reverse string")
3738
expect(Some(5), Util.lastIndexOf("..", "aaaa.."), "UtillastIndexOf should find Some")
3839
expect(None, Util.lastIndexOf("??", "aaaa.."), "Util.lastIndexOf should find None")
40+
expect("text/plain", Mediatype.guess("foo.txt"), "Mediatype.guess should find text/plain")
41+
expect("application/octet-stream", Mediatype.guess("foo.MADEUP"), "Mediatype.guess should find default type")
3942

4043
report()

0 commit comments

Comments
 (0)