diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py
index e02fec8..2f3f624 100644
a
|
b
|
class CachedFilesMixin(object):
|
153 | 153 | matched, url = matchobj.groups() |
154 | 154 | # Completely ignore http(s) prefixed URLs, |
155 | 155 | # fragments and data-uri URLs |
156 | | if url.startswith(('#', 'http:', 'https:', 'data:')): |
| 156 | if url.startswith(('#', 'http:', 'https:', 'data:', '//')): |
157 | 157 | return matched |
158 | 158 | name_parts = name.split(os.sep) |
159 | 159 | # Using posix normpath here to remove duplicates |
diff --git a/tests/regressiontests/staticfiles_tests/project/documents/cached/css/ignored.css b/tests/regressiontests/staticfiles_tests/project/documents/cached/css/ignored.css
new file mode 100644
index 0000000..fe7b022
-
|
+
|
|
| 1 | body { |
| 2 | background: url("#foobar"); |
| 3 | background: url("http:foobar"); |
| 4 | background: url("https:foobar"); |
| 5 | background: url("data:foobar"); |
| 6 | background: url("//foobar"); |
| 7 | } |
| 8 | |
diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py
index 8321fc2..034ddef 100644
a
|
b
|
class TestCollectionCachedStorage(BaseCollectionTestCase,
|
383 | 383 | self.assertNotIn(b"cached/other.css", content) |
384 | 384 | self.assertIn(b"other.d41d8cd98f00.css", content) |
385 | 385 | |
| 386 | def test_path_ignored_completely(self): |
| 387 | relpath = self.cached_file_path("cached/css/ignored.css") |
| 388 | #self.assertEqual(relpath, "cached/css/ignored.75433540b096.css") |
| 389 | with storage.staticfiles_storage.open(relpath) as relfile: |
| 390 | content = relfile.read() |
| 391 | self.assertIn(b'#foobar', content) |
| 392 | self.assertIn(b'http:foobar', content) |
| 393 | self.assertIn(b'https:foobar', content) |
| 394 | self.assertIn(b'data:foobar', content) |
| 395 | self.assertIn(b'//foobar', content) |
| 396 | |
386 | 397 | def test_path_with_querystring(self): |
387 | 398 | relpath = self.cached_file_path("cached/styles.css?spam=eggs") |
388 | 399 | self.assertEqual(relpath, |