Skip to content

talkcontrol


talkcontrol / server/services/presentation-url / validatePresentationUrl

Function: validatePresentationUrl()

validatePresentationUrl(raw): Promise<URL>

Defined in: src/server/services/presentation-url.ts:16

Validates a client-provided presentation URL against the anti-SSRF policy (IMP-001): http/https only, no private/special addresses, config allowlist for local dev hosts. DNS is resolved before validation so a public hostname cannot mask a private address.

Parameters

raw

string

Raw URL coming from the client (query param or cookie)

Returns

Promise<URL>

The parsed URL when allowed

Throws

'Invalid presentation URL' when unparsable, 'Presentation URL not allowed' when refused by policy