wai-app-file-cgi 3.1.1 → 3.1.2
raw patch · 4 files changed
+14/−2 lines, 4 files
Files
- Network/Wai/Application/Classic/CGI.hs +7/−0
- Network/Wai/Application/Classic/Field.hs +1/−1
- test/ClassicSpec.hs +5/−0
- wai-app-file-cgi.cabal +1/−1
Network/Wai/Application/Classic/CGI.hs view
@@ -116,6 +116,13 @@ #if __GLASGOW_HASKELL__ >= 707 , delegate_ctlc = False #endif+#if __GLASGOW_HASKELL__ >= 800+ , detach_console = False+ , create_new_console = False+ , new_session = False+ , child_group = Nothing+ , child_user = Nothing+#endif } (prog, scriptName, pathinfo) = pathinfoToCGI (cgiSrc cgii)
Network/Wai/Application/Classic/Field.hs view
@@ -64,7 +64,7 @@ | otherwise = [(hContentType, mimeType file)] mimeType :: ByteString -> MimeType-mimeType file =fromMaybe defaultMimeType . foldr1 mplus . map lok $ targets+mimeType file = fromMaybe defaultMimeType . foldr mplus Nothing . map lok $ targets where targets = extensions file lok x = SH.lookup x defaultMimeTypes'
test/ClassicSpec.hs view
@@ -29,6 +29,11 @@ bdy <- rspBody <$> sendGET url ans <- readFileAscii "test/html/index.html" bdy `shouldBe` ans+ it "works with files that lack a file extension" $ do+ let url = "http://127.0.0.1:2345/no_extension"+ bdy <- rspBody <$> sendGET url+ ans <- readFileAscii "test/html/no_extension"+ bdy `shouldBe` ans it "returns 400 if not exist" $ do let url = "http://127.0.0.1:2345/dummy" sc <- rspCode <$> sendGET url
wai-app-file-cgi.cabal view
@@ -1,5 +1,5 @@ Name: wai-app-file-cgi-Version: 3.1.1+Version: 3.1.2 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3