Web.decide: def of ezmcp@0.1.0.0 Import: import ezmcp@0.1.0.0/src/web.bend as Web Lines 204-219 of ezmcp@0.1.0.0/src/web.bend: https://jend.leeeet.dev/read.txt?path=ezmcp@0.1.0.0/src/web.bend&start_line=204&end_line=219 import Base import emerging-ezhttp@0.21.0.0/src/http.bend as Http import ezmcp@0.1.0.0/src/server.bend as Server # what the transport does with one HTTP request to an endpoint at `path`, # which allows the browser origins listed def decide( srv: Server.Server, path: String, origins: List<&2, String>, req: Http.Request ) -> Web: match req: case Http.Bad{why}: text(400, why) case Http.Request{+m, +target, +headers, body}: route(srv, String.eq(path.of(target), path), origin.ok(origins, Http.headers.find(headers, "Origin")), String.eq(m, "POST"), Http.headers.find(headers, "MCP-Protocol-Version"), body) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=Request https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=headers.find https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/server.bend&name=Server https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/web.bend&name=Web https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/web.bend&name=origin.ok https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/web.bend&name=path.of https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/web.bend&name=route https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/web.bend&name=text