on master help sign in
Removed cookie parsing code
commit51a6140a963362680eb9b8ede442d495a7ea6d37 authorMichael Snoyman <michael@snoyman.com> dateMon 20 Dec 2010, 23:48 (16 years ago) parent404fd11
1 file changed−15
Network/Wai/Parse.hs−15
Network/Wai/Parse.hs−15
@@ -4,7 +4,6 @@
44
55module Network.Wai.Parse
66 ( parseQueryString
7− , parseCookies
87 , parseHttpAccept
98 , parseRequestBody
109 , Sink (..)
@@ -92,20 +91,6 @@ qsDecode z = fst $ S.unfoldrN (S.length z) go z
9291 combine :: Word8 -> Word8 -> Word8
9392 combine a b = shiftL a 4 .|. b
9493
95−-- | Decode the value of an HTTP_COOKIE header into key/value pairs.
96−parseCookies :: S.ByteString -> [(S.ByteString, S.ByteString)]
97−parseCookies s
98− | S.null s = []
99− | otherwise =
100− let (first, rest) = breakDiscard 59 s -- semicolon
101− in parseCookie first : parseCookies rest
102−
103−parseCookie :: S.ByteString -> (S.ByteString, S.ByteString)
104−parseCookie s =
105− let (key, value) = breakDiscard 61 s -- equals sign
106− key' = S.dropWhile (== 32) key -- space
107− in (key', value)
108−
10994-- | Parse the HTTP accept string to determine supported content types.
11095parseHttpAccept :: S.ByteString -> [S.ByteString]
11196parseHttpAccept = map fst