django-referrer-policy
django-referrer-policy copied to clipboard
Unknown policy values
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):