1
0
forked from GitHub/gf-core

pgf-server HTTP mode: omit charset from ContentType for static files

When pfg-server servers a static file in HTTP mode, it is output as is, so
specifying charset="iso-8859-1" could be wrong. 

Note: the a charset can be specified with a meta tag in HTML files,
e.g. for files in UTF-8:

<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
This commit is contained in:
hallgren
2010-09-24 12:34:38 +00:00
parent 11bfee735d
commit 5e1f2c069f

View File

@@ -15,12 +15,12 @@ serveStaticFile' path =
contentTypeFromExt ext = contentTypeFromExt ext =
case ext of case ext of
".html" -> "text/html; charset=\"iso8859-1\"" ".html" -> "text/html"
".htm" -> "text/html; charset=\"iso8859-1\"" ".htm" -> "text/html"
".xml" -> "text/xml; charset=\"iso8859-1\"" ".xml" -> "text/xml"
".txt" -> "text/plain; charset=\"iso8859-1\"" ".txt" -> "text/plain"
".css" -> "text/css; charset=\"iso8859-1\"" ".css" -> "text/css"
".js" -> "text/javascript; charset=\"iso8859-1\"" ".js" -> "text/javascript"
".png" -> "image/png" ".png" -> "image/png"
".jpg" -> "image/jpg" ".jpg" -> "image/jpg"
_ -> "application/octet-stream" _ -> "application/octet-stream"