Http change or override Referer


#1

Hi,

I’m trying to override the referef header in a Http call. As I see do somithing like.

    let headers = new Headers();
    headers.append('Content-Type', 'application/x-www-form-urlencoded');
    headers.append('Referer', 'www.exampple.com');
    headers.append( 'Authorization', 'Basic ' + _authdata );

is unsafe. In the network monitor attached to my android device I see

Referrer Policy:no-referrer-when-downgrade

How can I modify the policy to force to send the Referer?

Thanks and best regards


#2

I think this is unrelated if I understood this correctly:
https://www.w3.org/TR/referrer-policy/#referrer-policy-no-referrer-when-downgrade


#3

Hi, thanks for the answer, but

If it is not related, why can not I see the Referer in the Header on the network monitor? I don’t receive it in the server. Why can not set the referer at header? It’s and Ionic restriction? Angular restriction?

Thnaks and best regards


#4

Hi,
its a browser restriction. You cant set the Referer header if you are making a browser request.
If you want to see who is sending the request you could use the ‘X-Requested-With’ header or use a custom header.