include all remotes back in

This commit is contained in:
Joey Hess 2019-12-02 12:26:33 -04:00
parent 1100e0d3c9
commit 650a631ef8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 31 additions and 27 deletions

View file

@ -17,6 +17,7 @@ import Utility.Url (URLString)
#ifdef mingw32_HOST_OS
import Utility.Split
#endif
import Utility.FileSystemEncoding
import System.FilePath.Posix -- for manipulating url paths
import Network.Protocol.HTTP.DAV (inDAVLocation, DAVT)
@ -50,10 +51,12 @@ keyLocation k = keyDir k ++ keyFile k
- those. -}
exportLocation :: ExportLocation -> Either String DavLocation
exportLocation l =
let p = fromExportLocation l
in if any (`elem` p) ['#', '?']
let p = fromRawFilePath $ fromExportLocation l
in if any (`elem` p) illegalinurl
then Left ("Cannot store file containing '#' or '?' on webdav: " ++ p)
else Right p
where
illegalinurl = ['#', '?'] :: [Char]
{- Where we store temporary data for a key as it's being uploaded. -}
keyTmpLocation :: Key -> DavLocation