summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2010-09-02 13:54:16 +0000
committerhallgren <hallgren@chalmers.se>2010-09-02 13:54:16 +0000
commitdaa726d74241c0a9688be45e9521a75f2e15b337 (patch)
treee800cf73458cd5a608ab1c8fa054fb488c7b3bea /src/server
parent1fd51c0580d2cba5d0b7d430636968eb17d20270 (diff)
Bug fix: add missing error handler for statically served files in pgf-server HTTP mode
Diffstat (limited to 'src/server')
-rw-r--r--src/server/PGFService.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs
index 4d8cd2f51..c858752e0 100644
--- a/src/server/PGFService.hs
+++ b/src/server/PGFService.hs
@@ -49,6 +49,7 @@ httpMain cache port = runHTTP port (do log ; serve =<< getPath)
logCGI $ method++" "++uri
serve path =
+ handleErrors . handleCGIErrors $
if takeExtension path==".pgf"
then cgiMain' cache path
else if takeFileName path=="grammars.cgi"
@@ -71,11 +72,11 @@ fcgiMain cache =
getPath = getVarWithDefault "SCRIPT_FILENAME" ""
cgiMain :: Cache PGF -> CGI CGIResult
-cgiMain cache = cgiMain' cache =<< getPath
+cgiMain cache = handleErrors . handleCGIErrors $
+ cgiMain' cache =<< getPath
cgiMain' :: Cache PGF -> FilePath -> CGI CGIResult
cgiMain' cache path =
- handleErrors . handleCGIErrors $
do pgf <- liftIO $ readCache cache path
command <- liftM (maybe "grammar" (urlDecodeUnicode . UTF8.decodeString)) (getInput "command")
pgfMain pgf command