2 ms·
I have seen workers code that appears to remove Cf-Connecting-Ip prior to a fetch(), though no idea if that works. Maybe it just gets replaced with the workers
by tyingq 6y ago
I have seen workers code that appears to remove Cf-Connecting-Ip prior to a fetch(), though no idea if that works. Maybe it just gets replaced with the workers ip? Like:
router.route('/proxy/:url', '*', async (event) => {
event.request.headers.delete('cf-connecting-ip');
event.request.headers.delete('x-real-ip');
return await fetch(event.parameters.url,event.request);
Edit: Tried several variations of this. It doesn't work. The cf-connecting-ip header is always in the fetch request with the right data. It's a bit confusing because some of the Cloudflare tools don't show you all the headers.