Skip to content

UrlPolicyOptions

Defined in: src/util/validation.ts:170

Options for validateUrl.

Property Type Description Defined in
allowedSchemes? readonly string[] Allowed schemes, with the trailing colon (["https:", "http:"]). Default: any scheme except FORBIDDEN_URL_SCHEMES (app deep links such as myapp:// pass). src/util/validation.ts:176
allowLocalhost? boolean With requireHttps, still accept http: for localhost / loopback. Default true. src/util/validation.ts:183
maxLength? number Maximum length. Default 8192. src/util/validation.ts:187
policy? (url) => string | boolean | null | undefined Extra host-supplied check (an SSRF denylist…). Return a message or false to reject; true, null or undefined to accept. src/util/validation.ts:192
rejectCredentials? boolean Reject URLs with embedded credentials (https://user:pass@…). Default false. src/util/validation.ts:185
requireHttps? boolean Reject plain http: except for localhost (see allowLocalhost). Default false. Webhook endpoints set it; link destinations don’t. src/util/validation.ts:181