How to avoid http to https redirect in a worker fetch request to third-party site?

For Workes & Pages, what is the name of the domain?

What is the error message?

Too many redirects. http → https → http → https

What is the issue or error you’re encountering

Infinite redirect loop in a fetch request in a worker, that doesn’t occur when entering the url directly in your browser or developing locally

What steps have you taken to resolve the issue?

I looked at TLS/SSL settings in my website registration, but these options seems to apply to incoming calls only.
Also I tried to modify the fetch request with the redirect option set to manually and even downgraded the tls version.

What are the steps to reproduce the issue?

  1. Entering the following URL (of third party website) in your browser deliver results:
    http://api.anidb.net:9001/httpapi?client=animejs&clientver=1&protover=1&request=anime&aid=23

  2. That web site also exposes a https url, which is just a redirect to the url above:
    https://anidb.net/httpapi?client=animejs&clientver=1&protover=1&request=anime&aid=23

  3. The problem rises when making a fetch request with the url (from step 1). It triggers an infinite redirect loop that result in error “To Many requests”.

  4. In local development with miniflare this issue doesn’t exist. Even as entering the url (from step 1) in your browser it doesn’t trigger redirects. So what triggers the loop in a Cloudflare worker?

Screenshot of the error