Fix bug for complete URLs

This commit is contained in:
Michael Snoyman 2013-04-02 19:45:23 +03:00
parent 51eb7d4ba2
commit 04d51bdb4c

View File

@ -460,13 +460,12 @@ setUrl url' = do
site
(toTextUrl url')
url <- either (error . show) return eurl
-- FIXME deal with complete URLs
let (urlPath, urlQuery) = T.break (== '?') url
ST.modify $ \rbd -> rbd
{ rbdPath =
case DL.filter (/="") $ T.split (== '/') urlPath of
("http":_:rest) -> rest
("https":_:rest) -> rest
("http:":_:rest) -> rest
("https:":_:rest) -> rest
x -> x
, rbdGets = rbdGets rbd ++ H.parseQuery (TE.encodeUtf8 urlQuery)
}