def rewrite
import cswap-bend-cli@0.1.0.0/http.bend as Httpimport Base
134# With CSWAP_TEST_HTTP_BASE set (`base` non-empty), `https://host/path` goes to
135# `base/host/path`: plain http, same headers and body (contract section 5).
136def rewrite(+base: String, +url: String) -> String:
137 rewrite.pick(Bool.not(String.is_empty(base)) && String.starts_with(url, "https://"), base, url)