Skip to content

Commit b80e962

Browse files
committedFeb 21, 2017
doh
1 parent f4ea4f4 commit b80e962

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed
 

‎nikola/plugins/command/auto/__init__.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,8 @@ def serve_static(self, environ, start_response):
298298
p_uri = urlparse(uri)
299299
f_path = os.path.join(self.site.config['OUTPUT_FOLDER'], *[unquote(x) for x in p_uri.path.split('/')])
300300

301-
# mimetypes.guess_type can't handle query strings, so we need
302-
# to strip the URI to only the path for mimetype guessing
303-
stripped_uri = urlparse.urljoin(url, p_uri.path)
304-
305301
# ‘Pretty’ URIs and root are assumed to be HTML
306-
mimetype = 'text/html' if uri.endswith('/') else mimetypes.guess_type(stripped_uri)[0] or 'application/octet-stream'
302+
mimetype = 'text/html' if uri.endswith('/') else mimetypes.guess_type(p_uri.path)[0] or 'application/octet-stream'
307303

308304
if os.path.isdir(f_path):
309305
if not p_uri.path.endswith('/'): # Redirect to avoid breakage

0 commit comments

Comments
 (0)
Please sign in to comment.