Skip to content
Permalink
Browse files

Safari didn’t like HTML in octet-streams one bit

  • Loading branch information
da2x committed Jul 30, 2015
1 parent 3d81974 commit 5d894a9e0581610b5720e5b531eb41b3b54b1dce
Showing with 3 additions and 1 deletion.
  1. +3 −1 nikola/plugins/command/auto/__init__.py
@@ -286,7 +286,9 @@ def serve_static(self, environ, start_response):
uri = wsgiref.util.request_uri(environ)
p_uri = urlparse(uri)
f_path = os.path.join(self.site.config['OUTPUT_FOLDER'], *p_uri.path.split('/'))
mimetype = mimetypes.guess_type(uri)[0] or 'application/octet-stream'

# ‘Pretty’ URIs and root are assumed to be HTML
mimetype = 'text/html' if uri.endswith('/') else mimetypes.guess_type(uri)[0] or 'application/octet-stream'

if os.path.isdir(f_path):
f_path = os.path.join(f_path, self.site.config['INDEX_FILE'])

0 comments on commit 5d894a9

Please sign in to comment.
You can’t perform that action at this time.