Skip to content

[Workers] Document that only standard ports are supported by fetch() #4299

Description

@KianNH

Product

  • Workers
  • Presumably Pages Functions

Subject Matter

When using a local development environment like Miniflare or the Workers Preview available through Quick Edit in the dashboard, using fetch() on non-standard ports is supported. As an example, fetch("https://example.org:8080") would fetch on port 8080.

However, when published into production, non-standard ports are disregarded. fetch("https://example.org:8080") would fetch on port 443 as that is the default port for the https:// scheme and fetch("http://example.org:8080") would fetch on port 80 as that is the default port for the http:// scheme.

This isn't currently documented and causes a lot of confusion when people are developing for endpoints that are on non-standard ports and since it works locally and in previews, expect it to work when published into production.

Content Location

Uncertainty around this is why I decided to make an issue rather than a PR - where do we put it?

Is it a known issue that'll be fixed, is it a known limitation that won't be changed or do we put it under the fetch or request API docs as an aside?

Metadata

Metadata

Labels

content:newRequest for new/missing contentdocumentationDocumentation edits

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions