Skip to content

Home > @opengovsg/validators > UrlValidatorOptions

UrlValidatorOptions interface ​

The options to use for URL validation.

Signature:

typescript
export interface UrlValidatorOptions

Properties ​

PropertyModifiersTypeDescription
baseOrigin?string(Optional) The base origin to use for relative URLs. If no base origin is provided, relative URLs will be considered invalid. An origin does not include the path or query parameters. For example, a valid base origin is https://example.com or http://localhost:3000.
whitelist?UrlValidatorWhitelist(Optional) The list of allowed protocols and hostnames for URL validation. The default whitelist allows only http and https protocols, and does not restrict hostnames.