From: pho Date: Sun, 3 Jun 2007 09:10:58 +0000 (+0900) Subject: Bugfix of Utils.parseWWWFormURLEncoded X-Git-Tag: RELEASE-0_2_1~41 X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=5778aa6d13c20560e633e8a6f77c3e7f55ea1e51;p=Lucu.git Bugfix of Utils.parseWWWFormURLEncoded darcs-hash:20070603091058-62b54-203292c1c3cc7ebf1d814ccae219b5b51765d1fa.gz --- diff --git a/Network/HTTP/Lucu/Utils.hs b/Network/HTTP/Lucu/Utils.hs index d7ace3f..1619f36 100644 --- a/Network/HTTP/Lucu/Utils.hs +++ b/Network/HTTP/Lucu/Utils.hs @@ -69,7 +69,9 @@ parseWWWFormURLEncoded :: String -> [(String, String)] parseWWWFormURLEncoded src | src == "" = [] | otherwise = do pairStr <- splitBy (\ c -> c == ';' || c == '&') src - let pair = break (== '=') pairStr - return ( unEscapeString $ fst pair - , unEscapeString $ snd pair + let (key, value) = break (== '=') pairStr + return ( unEscapeString key + , unEscapeString $ case value of + ('=':val) -> val + "" -> "" )