def cookie.default_path

bend-kit-http@0.38.2.0 · http.bend:1934

import bend-kit-http@0.38.2.0/http.bend as Http
import Base

1934# §5.1.4: the request path up to its last "/", or "/".
1935def cookie.default_path(+p: String) -> String:
1936  +up = String.reverse(cookie.up(String.reverse(p)))
1937  Bool.pick(String, Bool.or(Bool.not(String.starts_with(p, "/")), String.is_empty(up)), "/", up)

Uses (8)

Used by (1)