URLs resolved against a base URL as a browser resolves them, and checked against a set of allowed schemes.
A URL is resolved by RFC 3986, section 5, with the changes of the WHATWG URL Standard that browsers make, as of 2026-10-10:
TODO: the host parser of the URL Standard, which maps a domain by IDNA, reads the numbers of an IPv4 address in any base, compresses an IPv6 address and rejects the forbidden code points, and the drive letters of file URLs.
URLs resolved against a base URL as a browser resolves them, and checked against a set of allowed schemes. A URL is resolved by RFC 3986, section 5, with the changes of the WHATWG URL Standard that browsers make, as of 2026-10-10: - tabs and line breaks are dropped, and so are the control characters and spaces at the ends - in a URL of a special scheme, e.g. http, a backslash is a slash, the path is at least /, the host is in lower case and a default port is left out - a URL of the scheme of its base and no authority is relative, e.g. http:g, and a URL of a special scheme reads its authority past any number of slashes - a dot segment can be percent-encoded, e.g. %2e%2e - the characters of the percent-encode sets are percent-encoded as UTF-8 TODO: the host parser of the URL Standard, which maps a domain by IDNA, reads the numbers of an IPv4 address in any base, compresses an IPv6 address and rejects the forbidden code points, and the drive letters of file URLs.
(resolve base s)The URL s resolved against the absolute URL base, and normalized as
a browser normalizes it, or nil when it isn't valid. With no base, only
an absolute URL is valid.
(resolve "http://a/b/c/d;p?q" "../g")
;; => "http://a/b/g"
The URL `s` resolved against the absolute URL `base`, and normalized as
a browser normalizes it, or nil when it isn't valid. With no `base`, only
an absolute URL is valid.
(resolve "http://a/b/c/d;p?q" "../g")
;; => "http://a/b/g"(resolver base)A function of a URL that resolves it against the absolute URL base, as
resolve does, but reads the base only once.
A function of a URL that resolves it against the absolute URL `base`, as resolve does, but reads the base only once.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |