on master help sign in
proper name.
commite087d4349aa959af96c556fb52f00b54fea2eae2 authorKazu Yamamoto <kazu@iij.ad.jp> dateFri 1 Nov 2013, 13:43 (13 years ago) parent9859251
1 file changed+8−8
warp/Network/Wai/Handler/Warp/RequestHeader.hs+8−8
warp/Network/Wai/Handler/Warp/RequestHeader.hs+8−8
@@ -26,7 +26,7 @@ parseHeaderLines :: [ByteString]
2626parseHeaderLines [] = throwIO $ NotEnoughLines []
2727parseHeaderLines (firstLine:otherLines) = do
2828 (method, path', query, httpversion) <- parseRequestLine firstLine
29− let path = parseRpath path'
29+ let path = parsePath path'
3030 hdr = map parseHeader otherLines
3131 return (method, path, query, httpversion, hdr)
3232
@@ -53,18 +53,18 @@ parseRequestLine s =
5353
5454-- |
5555--
56−-- >>> parseRpath ""
56+-- >>> parsePath ""
5757-- "/"
58−-- >>> parseRpath "http://example.com/path"
58+-- >>> parsePath "http://example.com:8080/path"
5959-- "/path"
60−-- >>> parseRpath "http://example.com"
60+-- >>> parsePath "http://example.com"
6161-- ""
62−-- >>> parseRpath "/path"
62+-- >>> parsePath "/path"
6363-- "/path"
6464
65−-- FIXME: parseRpath "http://example.com" should be "/"?
66−parseRpath :: ByteString -> ByteString
67−parseRpath path
65+-- FIXME: parsePath "http://example.com" should be "/"?
66+parsePath :: ByteString -> ByteString
67+parsePath path
6868 | S.null path = "/"
6969 | "http://" `S.isPrefixOf` path = extractPath path
7070 | otherwise = path