Skip to content
Permalink
Browse files

merged master

  • Loading branch information
ralsina committed Aug 24, 2015
2 parents 34509eb + 3ae5d5e commit 82b4a60317c2b29b779dd8aa1a001a5c10e9824d
Showing with 11 additions and 5 deletions.
  1. +1 −1 CHANGES.txt
  2. +5 −2 nikola/plugins/command/auto/__init__.py
  3. +4 −1 nikola/plugins/command/serve.py
  4. +1 −1 requirements-tests.txt
@@ -11,7 +11,7 @@ Bugfixes
--------

* Add dependency on metadata file for 2-file posts (Issue #1968)

* Set UTF-8 charset in Content-Type or text/* and *+xml (Issue #1966)

New in v7.6.4
=============
@@ -300,11 +300,14 @@ def serve_static(self, environ, start_response):
mimetype = 'text/html'

if p_uri.path == '/robots.txt':
start_response('200 OK', [('Content-type', 'text/plain')])
start_response('200 OK', [('Content-type', 'text/plain; charset=UTF-8')])
return ['User-Agent: *\nDisallow: /\n'.encode('utf-8')]
elif os.path.isfile(f_path):
with open(f_path, 'rb') as fd:
start_response('200 OK', [('Content-type', mimetype)])
if mimetype.startswith('text/') or mimetype.endswith('+xml'):
start_response('200 OK', [('Content-type', "{0}; charset=UTF-8".format(mimetype))])
else:
start_response('200 OK', [('Content-type', mimetype)])
return [self.file_filter(mimetype, fd.read())]
elif p_uri.path == '/livereload.js':
with open(LRJS_PATH, 'rb') as fd:
@@ -242,7 +242,10 @@ def send_head(self):
f.seek(0)

self.send_response(200)
self.send_header("Content-type", ctype)
if ctype.startswith('text/') or ctype.endswith('+xml'):
self.send_header("Content-Type", "{0}; charset=UTF-8".format(ctype))
else:
self.send_header("Content-Type", ctype)
if os.path.splitext(path)[1] == '.svgz':
# Special handling for svgz to make it work nice with browsers.
self.send_header("Content-Encoding", 'gzip')
@@ -2,7 +2,7 @@
mock==1.3.0
coverage==3.7.1
pytest==2.7.2
pytest-cov==2.0.0
pytest-cov==2.1.0
freezegun==0.3.5
python-coveralls==2.5.0
colorama==0.3.3

0 comments on commit 82b4a60

Please sign in to comment.