def res.rel.go

bend-net-url@0.4.0.0 · url.bend:471

import bend-net-url@0.4.0.0/url.bend as Url
import Base

471# §5.2.2: an empty path keeps the base path (and its query unless one is given);
472# "/..." replaces the path; anything else merges with the base directory.
473def res.rel.go(+scheme: String, +host: String, +port: U32, +bpath: String, +bq: String, +bhas: Bool, +rp: String, +q: String, +rhas: Bool) -> Maybe<&2, Abs>:
474  Bool.pick(Maybe<&2, Abs>, String.is_empty(rp),
475    Bool.pick(Maybe<&2, Abs>, rhas, res.build(scheme, host, port, bpath, q, True{}), res.build(scheme, host, port, bpath, bq, bhas)),
476    res.build(scheme, host, port, remove_dots(Bool.pick(String, String.starts_with(rp, "/"), rp, dir(bpath) ++ rp)), q, rhas))

Uses (12)

Used by (1)