From 6633ae71f1be152bffad04004570bb4c3d348a81 Mon Sep 17 00:00:00 2001 From: bjorn Date: Mon, 20 Oct 2008 15:17:57 +0000 Subject: gf-server: move some general stuff to FastCGIUtils --- src/server/MainFastCGI.hs | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/server/MainFastCGI.hs') diff --git a/src/server/MainFastCGI.hs b/src/server/MainFastCGI.hs index 9734ab2f3..84fd3108e 100644 --- a/src/server/MainFastCGI.hs +++ b/src/server/MainFastCGI.hs @@ -154,26 +154,3 @@ selectLanguage pgf macc = case acceptable of langCodeLanguage :: PGF -> String -> Maybe PGF.Language langCodeLanguage pgf code = listToMaybe [l | l <- PGF.languages pgf, PGF.languageCode pgf l == Just code] - --- * General CGI and JSON stuff - -outputJSONP :: JSON a => a -> CGI CGIResult -outputJSONP x = - do mc <- getInput "jsonp" - let str = case mc of - Nothing -> encode x - Just c -> c ++ "(" ++ encode x ++ ")" - setHeader "Content-Type" "text/json; charset=utf-8" - outputStrict $ UTF8.encodeString str - -outputStrict :: String -> CGI CGIResult -outputStrict x | x == x = output x - | otherwise = fail "I am the pope." - --- * General utilities - -splitBy :: (a -> Bool) -> [a] -> [[a]] -splitBy _ [] = [[]] -splitBy f list = case break f list of - (first,[]) -> [first] - (first,_:rest) -> first : splitBy f rest \ No newline at end of file -- cgit v1.2.3