fix / escape
This commit is contained in:
parent
03d6209e1c
commit
e4ba0934c2
1 changed files with 2 additions and 1 deletions
|
@ -79,8 +79,9 @@ url2file :: URI -> IO FilePath
|
||||||
url2file url = do
|
url2file url = do
|
||||||
whenM (doesFileExist file) $
|
whenM (doesFileExist file) $
|
||||||
error $ "already have this url in " ++ file
|
error $ "already have this url in " ++ file
|
||||||
|
liftIO $ print file
|
||||||
return file
|
return file
|
||||||
where
|
where
|
||||||
file = escape $ uriRegName auth ++ uriPath url ++ uriQuery url
|
file = escape $ uriRegName auth ++ uriPath url ++ uriQuery url
|
||||||
escape = replace "/?" $ repeat '_'
|
escape = replace "/" "_" . replace "?" "_"
|
||||||
auth = fromMaybe (error $ "bad url " ++ show url) $ uriAuthority url
|
auth = fromMaybe (error $ "bad url " ++ show url) $ uriAuthority url
|
||||||
|
|
Loading…
Add table
Reference in a new issue