Skip to content

Commit 52a4e8a

Browse files
committed
Serve cabal files as text/plain (fixes haskell#176)
1 parent 590acd6 commit 52a4e8a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Distribution/Server/Framework/HappstackUtils.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ uriEscape = URI.escapeURIString URI.isAllowedInURI
5252
mime :: FilePath -> String
5353
mime x = Map.findWithDefault "text/plain; charset=utf-8" (drop 1 (takeExtension x)) mimeTypes'
5454
where
55-
mimeTypes' = mimeTypes `Map.union` Map.fromList [("xhtml", "application/xhtml+xml")]
55+
mimeTypes' = customMimeTypes `Map.union` mimeTypes
56+
customMimeTypes = Map.fromList
57+
[ ("xhtml", "application/xhtml+xml")
58+
, ("cabal", "text/plain")
59+
]
5660

5761

5862

0 commit comments

Comments
 (0)