summaryrefslogtreecommitdiff
path: root/src/server/FastCGIUtils.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2013-01-09 13:28:45 +0000
committerhallgren <hallgren@chalmers.se>2013-01-09 13:28:45 +0000
commit1497fd863ae7b1d4b2c1f7144a1d2753875bae75 (patch)
treeb0ef46ada23c974e8b59492b73295ebcb6d4e9ab /src/server/FastCGIUtils.hs
parent580e443a5eb731b50a84a7bc9aa9c3007d3a50f2 (diff)
PGF service: new command: download
This makes it possible to download PGF files from servers where the PGF service is installed. I am also considering making commmand=download the default instead of command=grammar.
Diffstat (limited to 'src/server/FastCGIUtils.hs')
-rw-r--r--src/server/FastCGIUtils.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/server/FastCGIUtils.hs b/src/server/FastCGIUtils.hs
index 2abc66072..05aa29eac 100644
--- a/src/server/FastCGIUtils.hs
+++ b/src/server/FastCGIUtils.hs
@@ -3,9 +3,8 @@ module FastCGIUtils (--initFastCGI, loopFastCGI,
throwCGIError, handleCGIErrors,
stderrToFile,logError,
outputJSONP,outputEncodedJSONP,
- outputPNG,
- outputHTML,
- outputPlain,
+ outputPNG,outputBinary,
+ outputHTML,outputPlain,
splitBy) where
import Control.Concurrent
@@ -177,14 +176,19 @@ outputPNG x = do
setHeader "Content-Type" "image/png"
outputFPS x
+outputBinary :: BS.ByteString -> CGI CGIResult
+outputBinary x = do
+ setHeader "Content-Type" "application/binary"
+ outputFPS x
+
outputHTML :: String -> CGI CGIResult
outputHTML x = do
- setHeader "Content-Type" "text/html"
+ setHeader "Content-Type" "text/html; charset=utf-8"
outputStrict $ UTF8.encodeString x
outputPlain :: String -> CGI CGIResult
outputPlain x = do
- setHeader "Content-Type" "text/plain"
+ setHeader "Content-Type" "text/plain; charset=utf-8"
outputStrict $ UTF8.encodeString x
outputStrict :: String -> CGI CGIResult