Reputation: 346
When I make a request with the library requests
headers are added to it:
{
'X-Forwarded-For': 'XXX.XXX.XXX.XXX,YYY.YYY.YYY.YYY',
'X-Forwarded-Proto': 'https',
'Cdn-Loop': 'cloudflare',
'Do-Connecting-Ip': 'XXX.XXX.XXX.XXX'
}
How can I avoid adding these headers?
Upvotes: 0
Views: 419
Reputation: 23815
The CDN (cloudflare) is adding those headers. The CDN is a "between" your request and the server.
Read about the header X-Forwarded-For
The X-Forwarded-For (XFF) header is a de-facto standard header for identifying the originating IP address of a client connecting to a web server through an HTTP proxy or a load balancer. When traffic is intercepted between clients and servers, server access logs contain the IP address of the proxy or load balancer only. To see the original IP address of the client, the X-Forwarded-For request header is used.
Why do you care about those headers?
Upvotes: 2