Commit 0a004d9b authored by Michael Hanus 's avatar Michael Hanus

Superfluous \n removed for HtmlAnswer output

parent 5a80a889
......@@ -336,6 +336,8 @@ answerEncText :: String -> String -> HtmlPage
answerEncText enc = HtmlAnswer ("text/plain; charset="++enc)
--- Generates a redirection page to a given URL.
--- This is implemented via the HTTP response header `Location` (see also
--- <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location>).
--- @param url - The URL target of the redirection
--- @param page - The redirection page
redirectPage :: String -> HtmlPage
......@@ -945,9 +947,8 @@ showsHtmlOpenTag tag attrs close =
--- @param page - the HTML page
--- @return string representation of the HTML document
showHtmlPage :: HtmlPage -> String
showHtmlPage (HtmlAnswer _ _) =
error "HTML.Base.showHtmlPage: cannot show HtmlAnswer"
showHtmlPage (HtmlPage title params html) =
showHtmlPage (HtmlAnswer _ cont) = cont
showHtmlPage (HtmlPage title params html) =
htmlPrelude ++
showHtmlExp (HtmlStruct "html" htmlTagAttrs
[HtmlStruct "head" []
......
......@@ -74,8 +74,8 @@ catchFormErrors formact = catch formact showFormError
--- Shows a HTML page on stdout.
printPage :: HtmlPage -> IO ()
printPage (HtmlAnswer ctype cont) = do
putStrLn $ "Content-Length: " ++ show (length cont) ++
"\nContent-Type: " ++ ctype ++ "\n\n" ++ cont
putStr $ "Content-Length: " ++ show (length cont) ++
"\nContent-Type: " ++ ctype ++ "\n\n" ++ cont
printPage p@(HtmlPage _ _ _) = do
let (headerstring,hpage) = extractHeader p
putStrLn $ headerstring ++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment