def closing
import gralha-http-server@0.1.0.0/server.bend as Serverimport 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"))