django-referrer-policy icon indicating copy to clipboard operation
django-referrer-policy copied to clipboard

Unknown policy values

Open blighj opened this issue 6 years ago • 0 comments

The spec makes it possible to send multiple comma-separated values, with the last supported one being used by browsers. This can help with supporting browsers who have partial support. https://w3c.github.io/webappsec-referrer-policy/#unknown-policy-values

were VALID_REFERRER_POLICIES a set, you could then do something like

if not hasattr(settings, 'REFERRER_POLICY') or \`
    not isinstance(settings.REFERRER_POLICY, str) or \
    not set(settings.REFERRER_POLICY.split(",")).issubset(self.VALID_REFERRER_POLICIES):

blighj avatar Jul 06 '18 06:07 blighj