Http.rewrite: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/http.bend as Http Lines 134-137 of cswap-bend-cli@0.1.0.0/http.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/http.bend&start_line=134&end_line=137 import Base # With CSWAP_TEST_HTTP_BASE set (`base` non-empty), `https://host/path` goes to # `base/host/path`: plain http, same headers and body (contract section 5). def rewrite(+base: String, +url: String) -> String: rewrite.pick(Bool.not(String.is_empty(base)) && String.starts_with(url, "https://"), base, url) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.starts_with https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/http.bend&name=rewrite.pick