summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorstuebinm2021-12-26 23:50:22 +0100
committerstuebinm2022-01-02 01:55:49 +0100
commite03d5514f38ed4c2f1345c2eaf82789af00136ab (patch)
treeffe8c47dc63dc74b83795c82cba00072eb9684de /lib
parente8d993e2932ea1dc4826ad371abe274165521429 (diff)
urlencode dereferrer links
Diffstat (limited to 'lib')
-rw-r--r--lib/Uris.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Uris.hs b/lib/Uris.hs
index 3aad1da..598aa46 100644
--- a/lib/Uris.hs
+++ b/lib/Uris.hs
@@ -24,7 +24,7 @@ import GHC.Generics (Generic)
import GHC.TypeLits (KnownSymbol, symbolVal)
import Text.Regex.TDFA ((=~))
import Witherable (mapMaybe)
-
+import Network.URI.Encode as URI
data Substitution =
Prefixed { prefix :: Text, blocked :: [Text], allowed :: [Text], scope :: [String] }
@@ -98,7 +98,7 @@ applySubsts s substs uri = do
Prefixed {..}
| domain `elem` blocked -> Left IsBlocked
| domain `elem` allowed -> Right uri
- | otherwise -> Right (prefix <> domain <> rest)
+ | otherwise -> Right (prefix <> URI.encodeText uri)
Allowed _ domains -> if domain `elem` domains
then Right uri
else Left (DomainIsBlocked domains)