Permalink
Browse files

Fixed #801

Went with the simplest option of implementation which is only changing
it for the charset.
  • Loading branch information...
1 parent d457731 commit 4f604f453a2cf80aad11a384d98a8a5dc9b065b2 @balupton balupton committed Feb 21, 2014
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/lib/docpad.coffee
View
@@ -4523,12 +4523,13 @@ class DocPad extends EventEmitterGrouped
# Prepare
res.setHeaderIfMissing ?= (name, value) ->
- res.setHeader(name, value) if res.getHeader(name)? is false
+ res.setHeader(name, value) unless res.getHeader(name)
# Content Type + Encoding/Charset
encoding = document.get('encoding')
+ charset = 'utf-8' if encoding in ['utf8', 'utf-8']
contentType = document.get('outContentType') or document.get('contentType')
- res.setHeaderIfMissing('Content-Type', contentType + (if encoding isnt 'binary' then "; charset=#{encoding}" else ''))
+ res.setHeaderIfMissing('Content-Type', contentType + (if charset then "; charset=#{charset}" else ''))
# Cache-Control (max-age)
res.setHeaderIfMissing('Cache-Control', "public, max-age=#{config.maxAge}") if config.maxAge

0 comments on commit 4f604f4

Please sign in to comment.