From: pho Date: Wed, 3 Oct 2007 08:12:13 +0000 (+0900) Subject: Small fix X-Git-Tag: RELEASE-0_2_1~32 X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=commitdiff_plain;h=f1f2bf550b80e3a7522790d6609b0a5ab18b5150 Small fix darcs-hash:20071003081213-62b54-3f4948ce142bd4945bc8b967cb2eac827e326905.gz --- diff --git a/Network/HTTP/Lucu/MIMEType.hs b/Network/HTTP/Lucu/MIMEType.hs index 396a164..947cb00 100644 --- a/Network/HTTP/Lucu/MIMEType.hs +++ b/Network/HTTP/Lucu/MIMEType.hs @@ -9,6 +9,7 @@ module Network.HTTP.Lucu.MIMEType ) where +import qualified Data.ByteString.Lazy as B import Network.HTTP.Lucu.Parser import Network.HTTP.Lucu.Parser.Http import Network.HTTP.Lucu.Utils @@ -45,8 +46,11 @@ instance Read MIMEType where -- exception for parse error. parseMIMEType :: String -> MIMEType parseMIMEType str = case parseStr mimeTypeP str of - (Success t, _) -> t - _ -> error ("Unparsable MIME Type: " ++ str) + (Success t, r) -> if B.null r then + t + else + error ("unparsable MIME Type: " ++ str) + _ -> error ("unparsable MIME Type: " ++ str) mimeTypeP :: Parser MIMEType