cloudflare-docs icon indicating copy to clipboard operation
cloudflare-docs copied to clipboard

API does not mention that ports are stripped from URLs

Open sirganya opened this issue 1 year ago • 1 comments

Which Cloudflare product does this pertain to?

Workers

Existing documentation URL(s)

cloudflare-docs/content/workers/runtime-apis/fetch.md

Section that requires update

The API does not mention that ports are stripped from URLs. The fact that they're not in the dev or preview and the worker gives the appearance of being able to reach an external endpoint led me to spend days debugging an API. I wasted a huge amount of time tracking it down.

What needs to change?

Clarify big diversions from the norm.

How should it change?

Add a note to this effect.

Additional information

No response

sirganya avatar Jul 12 '22 17:07 sirganya

Related issue: https://github.com/cloudflare/cloudflare-docs/issues/4299

KianNH avatar Jul 12 '22 17:07 KianNH

Bump. This is still an issue. Its undocumented that non-80 and non-443 ports are ignored, and even WORSE, silently downgraded to port-80/443 for foreign random domains from fetch(). If CF says certain foreign origin ports are banned for security reasons, it should throw() in the worker or error 530/1000 instead of silently changing the non-std ports to 80/443. Some people on community.cloudflare.com claim any port works, but only to same origin/same IP/same DNS "your" origin, but I never tried to verify that,

bulk88 avatar Dec 18 '22 09:12 bulk88

#5998

deadlypants1973 avatar Jan 31 '23 16:01 deadlypants1973

This is addressed by changes made for #5998 and now present at https://developers.cloudflare.com/workers/platform/known-issues/#custom-ports

kodster28 avatar Feb 17 '23 00:02 kodster28