Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error int the Failed to set referrer policy

I'm getting the following error in my chrome console for a Wordpress site I'm working on.

Failed to set referrer policy: The value 'http://example.com/comic/' is not one of 'always', 'default', 'never', 'no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-crossorigin', or 'unsafe-url'. The referrer policy has been left unchanged.

It's reffereing to this line in the <head> of the HTML document...

<meta name="Referrer" content="http://example.com/comic/" />

I'm vieing the page over http, not https.

What is causing this issue and how can I fix it?

like image 581
Holly Avatar asked Oct 09 '16 12:10

Holly


People also ask

How do I change referrer policy strict origin when cross origin?

You can already try out the change starting from Chrome 81: visit chrome://flags/#reduced-referrer-granularity in Chrome and enable the flag. When this flag is enabled, all websites without a policy will use the new strict-origin-when-cross-origin default. Enabling the flag.

How do I add a referrer policy in Wordpress?

To access the new options that are provided by the Security Headers plugin, hover over Settings, then click on HTTP Headers. Inside the plugin's options page, look for a drop-down labeled HTTP Referrer Policy and select your desired referrer policy.

What is referrer policy?

Referrer-Policy is a security header that can (and should) be included on communication from your website's server to a client. The Referrer-Policy tells the web-browser how to handle referrer information that is sent to websites when a user clicks a link that leads to another page or website.

What is referrer policy no referrer when downgrade?

The " no-referrer-when-downgrade " policy sends a full URL along with requests from a TLS-protected environment settings object to a potentially trustworthy URL, and requests from clients which are not TLS-protected to any origin.


2 Answers

Here 's the definition taken from the specs:

A referrer policy modifies the algorithm used to populate the Referer header when fetching subresources, prefetching, or performing navigations. Every environment settings object has an algorithm for obtaining a referrer policy, which is used by default for all requests with that environment settings object as their request client.

Therefore Referral policy deals with what information (related to the url) the browser ships to a server to retrieve an external resource.

The options for the content attribute listed in the specs are :

  • no-referrer which specifies that no referrer information is to be sent along with requests made from a particular request client to any origin. The header will be omitted entirely.

  • no-referrer-when-downgrade doesn't send Referrer header to non priori authenticated url (if an https url links to an http url no header is sent)

  • same-origin policy specifies that a full URL, stripped for use as a referrer, is sent as referrer information when making same-origin requests from a particular request client. while Cross-origin requests won't contain referrer information.

  • origin sends the scheme, host, and port (basically, the subdomain) stripped of the full URL as a referrer, i.e. https://moz.com/example.html would simply send https://moz.com for all.

  • origin-when-cross-origin sends the format described in origin to cross-origin, while a full stripped URL is sent to same origin requests.

  • unsafe-url policy specifies that a full URL, stripped for use as a referrer, is sent along with both cross-origin requests and same-origin requests made from a particular request client.
    it's unsafe because it will leak origins and paths from TLS-protected resources to insecure origins.

  • The empty string "" corresponds to no referrer policy, causing a fallback to a referrer policy defined elsewhere, or in the case where no such higher-level policy is available, defaulting to no-referrer-when-downgrade.

  • always behaves like unsafe-url.

like image 41
maioman Avatar answered Oct 24 '22 05:10

maioman


Go into your .htaccess file and change the following:

Header set Referrer-Policy ""

to

Header set Referrer-Policy "origin"

That should fix the issue.

The reason is more than likely because you don’t have correct permissions on your .htaccess file that allows w3tc to make the changes it needs to.

like image 157
Deepesh Thapa Avatar answered Oct 24 '22 06:10

Deepesh Thapa