Mirror Response Using Cloudflare Worker

I have a situation whereby whenever I send a request from Server A to C, C will only respond to B. I don’t own Server C and for some reasons that’s the way they configure their response.

I followed the guide in this link: Using Cloudflare as a reverse proxy - Docs - PostHog

However, the result is that when I request to Server A, Server B responded.

How can I modify the code in the guide to fulfill my requirement?