diff options
| author | Tim Graham <timograham@gmail.com> | 2017-03-17 07:55:00 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-17 07:55:00 -0400 |
| commit | b536dcf6568ceb4d8aad22cd4e1d38c850980fb4 (patch) | |
| tree | e6a629849830d436fc2d1cccd8a2387ef43f1b09 /django | |
| parent | 6b4f018b2b3478d2a4a441ed52d43f6268ac89f3 (diff) | |
Fixed #27948 -- Removed incorrect unquote() in static serving views.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/staticfiles/views.py | 3 | ||||
| -rw-r--r-- | django/views/static.py | 3 |
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('/'): |
