1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #29022 -- Fixed handling protocol-relative URLs in ManifestStaticFilesStorage when STATIC_URL is set to /.

This commit is contained in:
Adam Zapletal
2024-02-23 22:36:15 -06:00
committed by Mariusz Felisiak
parent ef2434f850
commit 107aa76bcf
3 changed files with 31 additions and 2 deletions

View File

@@ -221,7 +221,7 @@ class HashedFilesMixin:
url = matches["url"]
# Ignore absolute/protocol-relative and data-uri URLs.
if re.match(r"^[a-z]+:", url):
if re.match(r"^[a-z]+:", url) or url.startswith("//"):
return matched
# Ignore absolute URLs that don't point to a static file (dynamic