Bugfix: directories with the same name occuring multiple times in the path could be accidentally replaced and fubar'd
This commit is contained in:
parent
1b7181302f
commit
e74d062bcd
2 changed files with 4 additions and 4 deletions
|
|
@ -208,13 +208,13 @@ class DjangoRedNoise(DjangoWhiteNoise):
|
|||
"""
|
||||
file_path = None
|
||||
if self.debug:
|
||||
file_path = finders.find(path.replace(self.static_prefix, ''))
|
||||
file_path = finders.find(path.replace(self.static_prefix, '', 1))
|
||||
|
||||
# The immediate assumption would be to just only do this in non-DEBUG
|
||||
# scenarios, but this here allows us to fall through to ROOT in DEBUG.
|
||||
if file_path is None:
|
||||
file_path = ('%s/%s' % (
|
||||
self.static_root, path.replace(self.static_prefix, '')
|
||||
self.static_root, path.replace(self.static_prefix, '', 1)
|
||||
)).replace('\\', '/')
|
||||
|
||||
if not isfile(file_path):
|
||||
|
|
@ -249,7 +249,7 @@ class DjangoRedNoise(DjangoWhiteNoise):
|
|||
nature, so we have separate methods.
|
||||
"""
|
||||
file_path = ('%s/%s' % (
|
||||
self.media_root, path.replace(self.media_prefix, '')
|
||||
self.media_root, path.replace(self.media_prefix, '', 1)
|
||||
)).replace('\\', '/')
|
||||
if isfile(file_path):
|
||||
files = {}
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -12,7 +12,7 @@ def read(*path):
|
|||
|
||||
setup(
|
||||
name='django-rednoise',
|
||||
version='1.0.4',
|
||||
version='1.0.5',
|
||||
author='Ryan McGrath',
|
||||
author_email='ryan@venodesigns.net',
|
||||
url='https://github.com/ryanmcgrath/django-rednoise/',
|
||||
|
|
|
|||
Reference in a new issue