1
0
forked from GitHub/gf-core

refactoring pgfMain now takes the file path directly

This commit is contained in:
Krasimir Angelov
2024-05-16 19:34:02 +02:00
parent 02e8dcbb56
commit efe00f88e3
2 changed files with 4 additions and 7 deletions

View File

@@ -117,8 +117,8 @@ handle logLn documentroot state0 cache execute stateVar conn = do
-- use/change the cwd. Access files by absolute paths only.
let path = translatePath rpath
in case (takeDirectory path,takeFileName path,takeExtension path) of
(_ ,_ ,".pgf") -> PS.pgfMain logLn conn cache [("PATH_TRANSLATED",path)] rq
(_ ,_ ,".ngf") -> PS.pgfMain logLn conn cache [("PATH_TRANSLATED",path)] rq
(_ ,_ ,".pgf") -> PS.pgfMain logLn conn cache path rq
(_ ,_ ,".ngf") -> PS.pgfMain logLn conn cache path rq
(dir,"grammars.cgi",_ ) -> addDate (grammarList dir query)
_ -> serveStaticFile conn rpath path
_ -> addDate (return $ resp400 upath)