Add MapContentType to redbean (#566)

This commit is contained in:
Paul Kulchenko 2022-08-22 22:02:58 -07:00 committed by GitHub
parent 8cab92a069
commit 91a3252434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 66 additions and 4 deletions

View file

@ -21,3 +21,12 @@ assert(0200 == 128)
assert("\e" == "\x1b")
assert("hi" * 3 == "hihihi")
assert("hello %d" % {123} == "hello 123")
-- test MapContentType
assert(MapContentType("txt") == "text/plain")
assert(MapContentType("htm") == "text/html")
assert(MapContentType("abc.htm") == "text/html")
assert(MapContentType("1") == nil)
MapContentType("1", "text/x-foo")
assert(MapContentType("1"), "text/x-foo")
assert(MapContentType("file.1"), "text/x-foo")