@classmethod
def _validate_source_list(cls, source_list):
    """
        The "special" source values of 'self', 'unsafe-inline', 'unsafe-eval', and 'none'
        must be quoted! "'self'". Without quotes they will not work as intended.
        http://django-csp.readthedocs.org/en/latest/configuration.html

        This is slightly stricter than the W3 spec, in that it disallows sources with the same
        name as any of the reserved_source_expressions (eg. if self or none resolved to a
        server). Conversely, it stops the user adding a non-functional, un-quoted source.

        In the final string:
            Legal:   " 'self';", " 'self' "
            Illegal: " self;",   " self "

        @param value: list of source values, each of which will be checked
        """
    msg = (
        "You included a special value in your CSP, but did not wrap it in quotes. eg. %s should be '%s'"
        )
    for v in cls.unquoted_reserved_source_expressions:
        if v in source_list:
            raise ValueError(msg % (v, v))
    return source_list
