﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26671	`ManifestStaticFilesStorage` does not work for CSS with URLs including `chrome` scheme	Tai Lee	Deepak Sattiraju	"One of the 3rd party CSS files used by our project contains CSS like this:

{{{
.sourceRow[exe_line=""true""] > .sourceLine {
    background-image: url(chrome://firebug/skin/exe.png);
    color: #000000;
}
}}}

This causes `ManifestStaticFilesStorage` to crash with:

{{{
Post-processing 'lodash/vendor/firebug-lite/skin/xp/debugger.css' failed!
Traceback (most recent call last):
  File ""./manage.py"", line 23, in <module>
    execute_from_command_line(sys.argv)
  File ""/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py"", line 354, in execute_from_command_line
    utility.execute()
  File ""/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py"", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/usr/local/lib/python2.7/dist-packages/django/core/management/base.py"", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File ""/usr/local/lib/python2.7/dist-packages/django/core/management/base.py"", line 445, in execute
    output = self.handle(*args, **options)
  File ""/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py"", line 168, in handle
    collected = self.collect()
  File ""/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py"", line 120, in collect
    raise processed
ValueError: The file 'lodash/vendor/firebug-lite/skin/xp/chrome:/firebug/skin/exe.png' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7faab0f72950>.
}}}

Looks like this `.startswith()` call needs to change to a regex, or at least include a few more known schemes:

https://github.com/django/django/blob/edcecaf0dea718a8fb216df478df0d151a9ba04d/django/contrib/staticfiles/storage.py#L166

{{{
            if url.startswith(('http:', 'https:', '//', '#', 'data:')):
                return matched
}}}

Something like this should do the trick (very briefly tested in interactive shell):

{{{
            if re.match(r'(?i)([a-z]+://|//|#|data:)', url):
                return matched
}}}
"	Bug	closed	contrib.staticfiles	dev	Normal	fixed	ManifestStaticFilesStorage chrome scheme	dsattiraju249@…	Ready for checkin	1	0	0	0	1	0
