summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hakyll.cabal1
-rw-r--r--src/Hakyll/Web/Preview/Server.hs3
2 files changed, 3 insertions, 1 deletions
diff --git a/hakyll.cabal b/hakyll.cabal
index 70d2f1b..8fafa5c 100644
--- a/hakyll.cabal
+++ b/hakyll.cabal
@@ -59,6 +59,7 @@ library
snap-core >= 0.4,
bytestring >= 0.9,
utf8-string >= 0.3,
+ HTTP >= 4000,
tagsoup >= 0.12,
hopenssl >= 1.4,
unix >= 2.4,
diff --git a/src/Hakyll/Web/Preview/Server.hs b/src/Hakyll/Web/Preview/Server.hs
index c550b69..94e890e 100644
--- a/src/Hakyll/Web/Preview/Server.hs
+++ b/src/Hakyll/Web/Preview/Server.hs
@@ -8,6 +8,7 @@ module Hakyll.Web.Preview.Server
import Control.Monad.Trans (liftIO)
import Control.Applicative ((<$>))
import Codec.Binary.UTF8.String
+import Network.HTTP.Base (urlDecode)
import System.FilePath ((</>))
import System.Directory (doesFileExist)
@@ -39,7 +40,7 @@ static directory preServe = do
let filePath = replaceAll "\\?$" (const "") -- Remove trailing ?
$ replaceAll "#[^#]*$" (const "") -- Remove #section
$ replaceAll "^/" (const "") -- Remove leading /
- $ decode $ SB.unpack uri
+ $ urlDecode $ decode $ SB.unpack uri
-- Try to find the requested file
r <- liftIO $ findFile $ map (directory </>) $