Commit 7d1ec0cf authored by Antoine Fontaine's avatar Antoine Fontaine 👣

Fix redirection when instance is in a subfolder

parent 877428c6
......@@ -46,10 +46,10 @@ server :: ConnectionPool -- ^ Database pool.
server pool pasteDir instanceUrl = return (homepage instanceUrl)
:<|> servePastes pool pasteDir
:<|> processUpload pool pasteDir instanceUrl
:<|> redirectToRoot
:<|> redirectToRoot instanceUrl
redirectToRoot :: [Text] -> Handler Text
redirectToRoot _ = throwError err303 { errHeaders = [("Location", "/")] }
redirectToRoot :: Text -> [Text] -> Handler Text
redirectToRoot instanceUrl _ = throwError err303 { errHeaders = [("Location", encodeUtf8 instanceUrl)] }
servePastes :: ConnectionPool -- ^ Database pool.
-> FilePath -- ^ Directory containing uploads.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment