Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Safari didn’t like HTML in octet-streams one bit
  • Loading branch information
da2x committed Jul 30, 2015
1 parent 3d81974 commit 5d894a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nikola/plugins/command/auto/__init__.py
Expand Up @@ -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'])
Expand Down

0 comments on commit 5d894a9

Please sign in to comment.