summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/contrib/staticfiles/views.py3
-rw-r--r--django/views/static.py3
2 files changed, 2 insertions, 4 deletions
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('/'):