Http.cookie.av.put: def of bend-kit-http@0.38.2.0 Import: import bend-kit-http@0.38.2.0/http.bend as Http Lines 2230-2248 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=2230&end_line=2248 import Base import bend-kit-time@0.3.0.0/time.bend as Time # An Expires or Max-Age that does not parse leaves the earlier one. A leading dot of Domain is dropped. def cookie.av.put(k: Av, a: Cav, +v: String) -> Cav: match k a: case AvExpires{} Cav{e, m, d, p, s, h, ss}: Cav{Maybe.or(&2, Time.Instant, cookie.date(v), e), m, d, p, s, h, ss} case AvMaxAge{} Cav{e, m, d, p, s, h, ss}: Cav{e, Maybe.or(&2, U32, cookie.max_age(v), m), d, p, s, h, ss} case AvDomain{} Cav{e, m, d, p, s, h, ss}: Cav{e, m, String.to_lower(Bool.pick(String, String.starts_with(v, "."), String.drop(v, 1n), v)), p, s, h, ss} case AvPath{} Cav{e, m, d, p, s, h, ss}: Cav{e, m, d, Some{v}, s, h, ss} case AvSecure{} Cav{e, m, d, p, s, h, ss}: Cav{e, m, d, p, True{}, h, ss} case AvHttpOnly{} Cav{e, m, d, p, s, h, ss}: Cav{e, m, d, p, s, True{}, ss} case AvSameSite{} Cav{e, m, d, p, s, h, ss}: Cav{e, m, d, p, s, h, cookie.same_site(v)} case AvOther{} Cav{e, m, d, p, s, h, ss}: Cav{e, m, d, p, s, h, ss} Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=Maybe.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.drop https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.starts_with https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.to_lower https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Av https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Cav https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=cookie.date https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=cookie.max_age https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=cookie.same_site https://jend.leeeet.dev/definition.txt?path=bend-kit-time@0.3.0.0/time.bend&name=Instant