Http.cookie.domain.of: def of bend-kit-http@0.38.2.0 Import: import bend-kit-http@0.38.2.0/http.bend as Http Lines 2275-2283 of bend-kit-http@0.38.2.0/http.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-http@0.38.2.0/http.bend&start_line=2275&end_line=2283 import Base # §5.7 steps 8–10: (domain, host-only), or None to ignore the cookie. # ponytail: the public-suffix check knows single-label suffixes only (com, org, localhost). Multi-label # ones (co.uk, github.io) need the publicsuffix.org list; ship it as data when a caller needs it. def cookie.domain.of(+host: String, +d: String) -> Maybe<&1, String & Bool>: +suffix = Bool.and(Bool.not(String.is_empty(d)), Bool.not(String.contains(d, "."))) +d2 = Bool.pick(String, Bool.and(suffix, String.eq(d, host)), "", d) Bool.pick(Maybe<&1, String & Bool>, Bool.or(Bool.and(suffix, Bool.not(String.eq(d, host))), Bool.not(cookie.ascii(d))), None{}, Bool.pick(Maybe<&1, String & Bool>, String.is_empty(d2), Some{(host, True{})}, Bool.pick(Maybe<&1, String & Bool>, cookie.domain_match(host, d2), Some{(d2, False{})}, None{}))) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.contains https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=cookie.ascii https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=cookie.domain_match