[Haskell-cafe] Network.CGI Content header problem in Firefox.

Edward Ing edward.ing at gmail.com
Thu Aug 7 12:39:02 EDT 2008


Hi,

I am doing some tests with Haskell to produce CGI programmes. I am
running Microsoft IIS 5.0 as the weberver executing haskell compile
executables that are cgi. If I set the header with a content type,
Firefox always reports the content-type as application/octet-stream,
and tries to initiate a download. IExplorer 6.0 does not report the
type at all. It seems like the setHeader function does not result in
sending headers.

Has anyone seen this problem.

Code snippet here

====
main :: IO()
main = runCGI $  handleErrors cgiMain

cgiMain :: CGI CGIResult
cgiMain  =  do
                x <- getVars
                y <- getInputs
                prog <- progURI
                query <- queryURI
                request <- requestURI
                path <- pathInfo
                inputs <- getInputs
               setHeader("Content-type" "text/plain")

                setCookie (Cookie "bbb" "hello" Nothing Nothing Nothing False )
                liftIO (putStr "asdfasdf")
                output $ (uris "prog" prog)
                            ++ (uris "query" query)
                            ++ (uris "request" request)
                            ++  "\npath: " ++ path ++ "\n"
                            ++  (varsToString inputs)
                             ++(varsToString x) ++ "\n\nVars\n"++
(varsToString y)


More information about the Haskell-Cafe mailing list