Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #801

Went with the simplest option of implementation which is only changing
it for the charset.
  • Loading branch information...
commit 4f604f453a2cf80aad11a384d98a8a5dc9b065b2 1 parent d457731
@balupton balupton authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/lib/docpad.coffee
View
5 src/lib/docpad.coffee
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.