Redirect.redirect.against: def of emerging-ezhttp@0.21.0.0 Import: import emerging-ezhttp@0.21.0.0/src/redirect.bend as Redirect Lines 230-246 of emerging-ezhttp@0.21.0.0/src/redirect.bend: https://jend.leeeet.dev/read.txt?path=emerging-ezhttp@0.21.0.0/src/redirect.bend&start_line=230&end_line=246 import Base # a Location of a known sort against the current URL's parts def redirect.against(scheme: String, host: String, port: U32, path: String, +loc: String, k: Sort) -> Maybe<&2, String>: match k: case Net{}: Some{scheme ++ ":" ++ loc} case Abs{}: Some{scheme ++ "://" ++ host ++ ":" ++ U32.show(port) ++ redirect.abs.of(redirect.split(loc))} case Stay{}: None{} case Query{}: Some{scheme ++ "://" ++ host ++ ":" ++ U32.show(port) ++ redirect.base(path) ++ loc} case Rel{}: Some{scheme ++ "://" ++ host ++ ":" ++ U32.show(port) ++ redirect.rel.of(redirect.base(path), redirect.split(loc))} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.show https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/redirect.bend&name=Sort https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/redirect.bend&name=redirect.abs.of https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/redirect.bend&name=redirect.base https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/redirect.bend&name=redirect.rel.of https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/redirect.bend&name=redirect.split