summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web/Preview
diff options
context:
space:
mode:
authorBenedict Eastaugh <benedict@eastaugh.net>2011-03-30 00:43:11 +0100
committerBenedict Eastaugh <benedict@eastaugh.net>2011-03-30 00:43:11 +0100
commit29072a5a63940254168b9b347eb122fb30c784be (patch)
tree53349fa61d0c37e1976120769217e586b42b0667 /src/Hakyll/Web/Preview
parent98a486987bf43a55f592cfdd3b944fd7240656b1 (diff)
downloadhakyll-29072a5a63940254168b9b347eb122fb30c784be.tar.gz
Correctly decode request URIs in the preview server.
Diffstat (limited to 'src/Hakyll/Web/Preview')
-rw-r--r--src/Hakyll/Web/Preview/Server.hs3
1 files changed, 2 insertions, 1 deletions
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 </>) $