Skip to content

Commit

Permalink
In uriPath: remove unEscapeString, and collapse consecutive spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Nov 13, 2008
1 parent aa62a58 commit 773b45b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Gitit.hs
Expand Up @@ -26,7 +26,6 @@ import System.IO.UTF8
import System.IO (stderr)
import System.IO.Error (isAlreadyExistsError)
import Control.Exception (bracket)
import Network.URI (unEscapeString)
import Prelude hiding (writeFile, readFile, putStrLn, putStr)
import System.Process
import System.Directory
Expand Down Expand Up @@ -343,9 +342,10 @@ handle pathtest meth responder =
else noHandle ]
else anyRequest noHandle

-- | Returns path portion of URI in unescaped form, and without initial /.
-- | Returns path portion of URI, without initial /.
-- Consecutive spaces are collapsed. We don't want to distinguish 'Hi There' and 'Hi There'.
uriPath :: String -> String
uriPath = unEscapeString . drop 1 . takeWhile (/='?')
uriPath = unwords . words . drop 1 . takeWhile (/='?')

handlePage :: Method -> (String -> Params -> Web Response) -> Handler
handlePage = handle isPage
Expand Down

0 comments on commit 773b45b

Please sign in to comment.