def closing

gralha-http-server@0.1.0.0 · server.bend:60

import gralha-http-server@0.1.0.0/server.bend as Server
import Base
import gralha-http-core@0.1.0.0/http.bend as Http

60# The response with Connection: close, unless it names a Connection.
61def closing(r: Http.Response) -> Http.Response:
62  match r:
63    case Http.Response{+s, +h, +b}:
64      Http.when(Http.Response, Http.header.has(h, "connection"), _ => Http.Response{s, h, b},
65        _ => Http.response.with(Http.Response{s, h, b}, "Connection", "close"))

Uses (4)

Used by (1)