cloudflare-docs
cloudflare-docs copied to clipboard
API does not mention that ports are stripped from URLs
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
Related issue: https://github.com/cloudflare/cloudflare-docs/issues/4299
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,
#5998
This is addressed by changes made for #5998 and now present at https://developers.cloudflare.com/workers/platform/known-issues/#custom-ports