summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hellkamp <marc@gsites.de>2015-12-13 17:12:55 +0100
committerMarcel Hellkamp <marc@gsites.de>2015-12-13 17:12:55 +0100
commit38da2690a29826a233615864f922b19aa431e716 (patch)
treeea4643718e000fc6d6d8875780ec918402694597
parentfbd79b7c36340338862a86e91d2aaba68168ebdb (diff)
parent49f479cbb262311f3472d5f2f2128fc4f03846de (diff)
downloadbottle-38da2690a29826a233615864f922b19aa431e716.tar.gz
Merge pull request #811 from mrkowalski/patch-1
Fix charset for application/javascript files
-rw-r--r--bottle.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bottle.py b/bottle.py
index f6e14b0..fd1a20d 100644
--- a/bottle.py
+++ b/bottle.py
@@ -2678,7 +2678,7 @@ def static_file(filename, root,
if encoding: headers['Content-Encoding'] = encoding
if mimetype:
- if mimetype[:5] == 'text/' and charset and 'charset' not in mimetype:
+ if (mimetype[:5] == 'text/' or mimetype == 'application/javascript') and charset and 'charset' not in mimetype:
mimetype += '; charset=%s' % charset
headers['Content-Type'] = mimetype