Skip to content

basalt / webhooks/src / effectivePort

Function: effectivePort() ​

> effectivePort(url): number | undefined

Defined in: webhooks/src/ssrf.ts:188

The destination port of a URL: the explicit one, or the scheme default (http: 80, https: 443). undefined for a scheme with no known default and no explicit port. WHATWG URL drops a port equal to the scheme default, so https://h:443 and https://h both yield 443.

Parameters ​

url ​

URL

Returns ​

number | undefined

Released under the MIT License.