[happstack-server: fix notFoundHtml and failHtml jeremy@n-heptane.com**20090413212902 - added DOCTYPE - fixed missing or invalid tags - escape string passed to failHtml so that Unicode renders and so that html tags are escaped ] hunk ./happstack-server/src/Happstack/Server/SimpleHTTP.hs 257 +import Data.Char (ord) hunk ./happstack-server/src/Happstack/Server/SimpleHTTP.hs 1378 -failHtml errString = "Happstack " - ++ ver ++ " Internal Server Error" +failHtml errString = + "" + ++ "Happstack " + ++ ver ++ " Internal Server Error" hunk ./happstack-server/src/Happstack/Server/SimpleHTTP.hs 1383 - ++ "

Something went wrong here
" - ++ "Internal server error
" + ++ "

Something went wrong here
" + ++ "Internal server error
" hunk ./happstack-server/src/Happstack/Server/SimpleHTTP.hs 1386 - ++ "

The error was \"" ++ errString ++ "\"

" + ++ "

The error was \"" ++ (escapeString errString) ++ "\"

" hunk ./happstack-server/src/Happstack/Server/SimpleHTTP.hs 1389 +escapeString :: String -> String +escapeString str = concatMap encodeEntity str + where + encodeEntity :: Char -> String + encodeEntity '<' = "<" + encodeEntity '>' = ">" + encodeEntity '&' = "&" + encodeEntity '"' = """ + encodeEntity c + | ord c > 127 = "&#" ++ show (ord c) ++ ";" + | otherwise = [c] + hunk ./happstack-server/src/Happstack/Server/SimpleHTTP.hs 1402 -notFoundHtml = "Happstack " - ++ ver ++ " File not found" +notFoundHtml = + "" + ++ "Happstack " + ++ ver ++ " File not found" hunk ./happstack-server/src/Happstack/Server/SimpleHTTP.hs 1407 - ++ "

Your file is not found
" - ++ "To try again is useless
" + ++ "

Your file is not found
" + ++ "To try again is useless
"