X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FUtils.hs;h=1070d66f28042193a0337b02f1e9d858d63c9403;hp=bfa2acfb72282d76a2dad31ed2871c28c0709fed;hb=b22e702f8161447a460847c6e6c97104c150534f;hpb=1ead053df6a792edafa9d714c4c038a8a9c3ad16 diff --git a/Network/HTTP/Lucu/Utils.hs b/Network/HTTP/Lucu/Utils.hs index bfa2acf..1070d66 100644 --- a/Network/HTTP/Lucu/Utils.hs +++ b/Network/HTTP/Lucu/Utils.hs @@ -8,7 +8,7 @@ module Network.HTTP.Lucu.Utils ( splitBy , quoteStr , parseWWWFormURLEncoded - , splitPathInfo + , uriPathSegments , trim , (⊲) @@ -92,10 +92,10 @@ parseWWWFormURLEncoded src plusToSpace '+' = ' ' plusToSpace c = c --- |>>> splitPathInfo "http://example.com/foo/bar" +-- |>>> uriPathSegments "http://example.com/foo/bar" -- ["foo", "bar"] -splitPathInfo ∷ URI → [ByteString] -splitPathInfo uri +uriPathSegments ∷ URI → [ByteString] +uriPathSegments uri = let reqPathStr = uriPath uri reqPath = [unEscapeString x | x ← splitBy (≡ '/') reqPathStr, (¬) (null x)] in