run: build
@echo ".:.:. Let's go .:.:."
- $(WHAT_TO_RUN)
$(MAKE) -C examples run
.setup-config: $(CABAL_FILE) Setup
find . -name '*~' -exec rm -f {} \;
$(MAKE) -C examples clean
-doc:
+doc: .setup-config Setup
./Setup haddock
install: build
handleStaticDir :: FilePath -> Resource ()
handleStaticDir basePath
= do extraPath <- getPathInfo
+ securityCheck extraPath
let path = basePath ++ "/" ++ joinWith "/" extraPath
handleStaticFile path
+ where
+ securityCheck :: Monad m => [String] -> m ()
+ securityCheck pathElems
+ = when (any (== "..") pathElems) $ fail ("security error: "
+ ++ joinWith "/" pathElems)