]> gitweb @ CieloNegro.org - Lucu.git/commitdiff
Bugfix of Utils.parseWWWFormURLEncoded
authorpho <pho@cielonegro.org>
Sun, 3 Jun 2007 09:10:58 +0000 (18:10 +0900)
committerpho <pho@cielonegro.org>
Sun, 3 Jun 2007 09:10:58 +0000 (18:10 +0900)
darcs-hash:20070603091058-62b54-203292c1c3cc7ebf1d814ccae219b5b51765d1fa.gz

Network/HTTP/Lucu/Utils.hs

index d7ace3f8309aab60c21f2c8c6c4362189a05bc73..1619f364e9de60a0738491f3bcc280593410905b 100644 (file)
@@ -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
+                                                 ""        -> ""
                             )