summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-01-27 16:30:03 +0000
committerhallgren <hallgren@chalmers.se>2014-01-27 16:30:03 +0000
commit88341987a812931435f373d32ac19f5d77585a31 (patch)
tree04f133c94febf9de6c18f255b52d4873700d8461 /src
parentdaa48610b5f9a6e28a4850722118d7acec7d89d1 (diff)
gf -server: fix a redirection bug...
...that was introduced with the recent changes to the handling of the current working directory
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GFServer.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/GFServer.hs b/src/compiler/GFServer.hs
index 5d4825829..6160a9f43 100644
--- a/src/compiler/GFServer.hs
+++ b/src/compiler/GFServer.hs
@@ -154,7 +154,7 @@ handle documentroot state0 cache execute1 stateVar
wrapCGI $ PS.cgiMain' cache path
(dir,"grammars.cgi",_ ) -> grammarList dir (decoded qs)
(dir ,"exb.fcgi" ,_ ) -> wrapCGI $ ES.cgiMain' root dir (fst cache)
- _ -> serveStaticFile path
+ _ -> serveStaticFile rpath path
where path = translatePath rpath
_ -> return $ resp400 upath
@@ -262,7 +262,7 @@ handle documentroot state0 cache execute1 stateVar
else err $ resp404 path
rm path = err $ resp400 $ "unacceptable extension "++path
- download path = liftIO $ serveStaticFile path
+ download path = liftIO $ serveStaticFile' path
link_directories olddir newdir@('/':'t':'m':'p':'/':_) | old/=new =
hmInDir ".." $ liftIO $
@@ -315,13 +315,13 @@ jsonresult cwd dir cmd (ecode,stdout,stderr) files =
-- * Static content
-serveStaticFile path =
+serveStaticFile rpath path =
do --logPutStrLn $ "Serving static file "++path
b <- doesDirectoryExist path
if b
- then if path `elem` ["","."] || last path=='/'
+ then if rpath `elem` ["","."] || last path=='/'
then serveStaticFile' (path </> "index.html")
- else return (resp301 (path++"/"))
+ else return (resp301 ('/':rpath++"/"))
else serveStaticFile' path
serveStaticFile' path =