Request Error: 'Referrer Policy: strict-origin-when-cross-origin' in Angular when build in --prod mode

Ahmed Ibrahim picture Ahmed Ibrahim · Dec 9, 2020 · Viewed 8.8k times · Source

I deployed my Angular application to https domain. And the API domain is http.

When I build my Angular app using --prod I got an error in requests that Referrer Policy: strict-origin-when-cross-origin, However when I build without --prod the requests are working perfectly.

Any ideas?

Answer

vinyll picture vinyll · Dec 12, 2020

If you're asking it means you're probably using a Chromium-based browser such as Brave, Chrome or others.

When connecting to an API, the request should pass a privacy policy. Chromium-based browser have recently changed the default policy.

You may want to have a look at the official reference about the Strict Origin when Cross Origin as this could eventually evolve again.

Note that when a Chromium-based browser is giving you some error, also trying with Firefox may give you an extra error message and help you understand what is blocking.