import { type RequestContext } from "https://deno.land/x/cav@0.0.21/mod.ts";
A metadata cache object generated once for every Request handled with a Cav handler (Stacks and Rpcs).
Properties
A ResponseInit applied to the Rpc response after resolving and packing the value to send to the client. The Headers object is always available.
The request path. This is intended to be modified by a Stack during request routing. When the RequestContext is initially generated, this is set to the url.pathname. As the request gets processed, the Stack matches this path against registered routes. When a route matches, this path will be set to the unmatched portion of the requested path before calling the matching route handler.
As Stacks process a request, they can capture path groups. The path groups are stored in this object. During name conflicts, old groups will be overwritten by groups captured further down the handler tree.
An object created from the url.searchParams. This is what gets processed when an Rpc has a "query" parser.
If this property isn't null, it's a redirect Response that should be returned as soon as possible. It means the client requested a non-canonical path that either ends in a trailing slash or contains empty path segments. Cav requires redirects all non-canonical paths to their canonical version.