Permalink
Browse files

Serve unknown file types as UTF-8, as suggested by @janmoesen

  • Loading branch information...
1 parent 1a71776 commit ec4b44ef05dfb0f3209c14d47d9875d4d6ff9bb6 @mathiasbynens committed Jan 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 .functions
View
@@ -8,7 +8,7 @@ function server() {
local port="${1:-8000}"
open "http://localhost:${port}/"
# Set the default Content-Type to `text/plain` instead of `application/octet-stream`
- python -c "import SimpleHTTPServer; import sys; sys.argv = [None, '$port']; SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map[''] = 'text/plain'; SimpleHTTPServer.test();"
+ python -c "import SimpleHTTPServer; import sys; sys.argv = [None, '$port']; SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map[''] = 'text/plain;charset=UTF-8'; SimpleHTTPServer.test();"
}
# Test if HTTP compression (RFC 2616 + SDCH) is enabled for a given URL.

0 comments on commit ec4b44e

Please sign in to comment.