X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FMIMEType.hs;h=1aebc9f56b1233b34a75384d6a45db7441125b7c;hp=ab0e06596320d343164211017a8725ada3b9f07b;hb=e49345ce5e6c0190c826d130d51ec42ee9f09a67;hpb=18192e5ea2b621a551db27aa39e221a05696e2b3 diff --git a/Network/HTTP/Lucu/MIMEType.hs b/Network/HTTP/Lucu/MIMEType.hs index ab0e065..1aebc9f 100644 --- a/Network/HTTP/Lucu/MIMEType.hs +++ b/Network/HTTP/Lucu/MIMEType.hs @@ -22,6 +22,7 @@ import Data.Attoparsec.Char8 as P import Data.Map (Map) import Data.Monoid.Unicode import Data.Text (Text) +import Network.HTTP.Lucu.Parser import Network.HTTP.Lucu.Parser.Http import Network.HTTP.Lucu.RFC2231 import Prelude hiding (min) @@ -59,15 +60,9 @@ printMIMEType (MIMEType maj min params) parseMIMEType ∷ Ascii → MIMEType {-# INLINEABLE parseMIMEType #-} parseMIMEType str - = case parseOnly p $ A.toByteString str of + = case parseOnly (finishOff mimeType) $ A.toByteString str of Right t → t Left err → error ("unparsable MIME Type: " ⧺ A.toString str ⧺ ": " ⧺ err) - where - p ∷ Parser MIMEType - {-# INLINE p #-} - p = do t ← mimeType - endOfInput - return t -- |'Parser' for an 'MIMEType'. mimeType ∷ Parser MIMEType