From b536dcf6568ceb4d8aad22cd4e1d38c850980fb4 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 17 Mar 2017 07:55:00 -0400 Subject: Fixed #27948 -- Removed incorrect unquote() in static serving views. --- django/contrib/staticfiles/views.py | 3 +-- django/views/static.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'django') diff --git a/django/contrib/staticfiles/views.py b/django/contrib/staticfiles/views.py index dfdbdac9e9..9987f49f73 100644 --- a/django/contrib/staticfiles/views.py +++ b/django/contrib/staticfiles/views.py @@ -5,7 +5,6 @@ development, and SHOULD NOT be used in a production setting. """ import os import posixpath -from urllib.parse import unquote from django.conf import settings from django.contrib.staticfiles import finders @@ -30,7 +29,7 @@ def serve(request, path, insecure=False, **kwargs): """ if not settings.DEBUG and not insecure: raise Http404 - normalized_path = posixpath.normpath(unquote(path)).lstrip('/') + normalized_path = posixpath.normpath(path).lstrip('/') absolute_path = finders.find(normalized_path) if not absolute_path: if path.endswith('/') or path == '': diff --git a/django/views/static.py b/django/views/static.py index 479c59cac6..03e8c34a1c 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -7,7 +7,6 @@ import os import posixpath import re import stat -from urllib.parse import unquote from django.http import ( FileResponse, Http404, HttpResponse, HttpResponseNotModified, @@ -34,7 +33,7 @@ def serve(request, path, document_root=None, show_indexes=False): but if you'd like to override it, you can create a template called ``static/directory_index.html``. """ - path = posixpath.normpath(unquote(path)) + path = posixpath.normpath(path) path = path.lstrip('/') newpath = '' for part in path.split('/'): -- cgit v1.3