summaryrefslogtreecommitdiff
path: root/src/server/FastCGIUtils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/FastCGIUtils.hs')
-rw-r--r--src/server/FastCGIUtils.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/FastCGIUtils.hs b/src/server/FastCGIUtils.hs
index 4c720e216..603ca0db3 100644
--- a/src/server/FastCGIUtils.hs
+++ b/src/server/FastCGIUtils.hs
@@ -2,7 +2,8 @@
module FastCGIUtils (initFastCGI, loopFastCGI,
throwCGIError, handleCGIErrors,
stderrToFile,
- outputJSONP,
+ outputJSONP,
+ outputPNG,
splitBy) where
import Control.Concurrent
@@ -164,6 +165,11 @@ outputJSONP x =
setHeader "Content-Type" "text/json; charset=utf-8"
outputStrict $ UTF8.encodeString str
+outputPNG :: String -> CGI CGIResult
+outputPNG x = do
+ setHeader "Content-Type" "image/png"
+ outputStrict x
+
outputStrict :: String -> CGI CGIResult
outputStrict x | x == x = output x
| otherwise = fail "I am the pope."