Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2645 (h/t @benaiah) #2679

Merged
merged 2 commits into from Feb 21, 2017
Merged

Fix #2645 (h/t @benaiah) #2679

merged 2 commits into from Feb 21, 2017

Conversation

ralsina
Copy link
Member

@ralsina ralsina commented Feb 21, 2017

No description provided.

@ralsina
Copy link
Member Author

ralsina commented Feb 21, 2017

@Benaiah I just adopted your fix, since it looked ok.

@@ -298,8 +298,12 @@ def serve_static(self, environ, start_response):
p_uri = urlparse(uri)
f_path = os.path.join(self.site.config['OUTPUT_FOLDER'], *[unquote(x) for x in p_uri.path.split('/')])

# mimetypes.guess_type can't handle query strings, so we need
# to strip the URI to only the path for mimetype guessing
stripped_uri = urlparse.urljoin(url, p_uri.path)
Copy link
Member

@Kwpolska Kwpolska Feb 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is url defined?

Copy link
Member Author

@ralsina ralsina Feb 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, brainfart, the right thing is to just use p_uri.path there. Pushed.

@ralsina ralsina merged commit 200f023 into master Feb 21, 2017
@ralsina ralsina deleted the fix-2645 branch Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants