method IGrpcService.claims
Since 0.3.0
IGrpcService.claims(request: Request): boolean

Whether this service claims a request — that is, whether the request path lies inside the configured basePath.

The kernel terminal handler calls this before IGrpcService.handleRequest so an ordinary unmatched route keeps the kernel's own 404. That guard cannot be derived from handleRequest, which returns Promise<Response> and never null: a path outside the base path is indistinguishable from a claimed path with no such procedure once both have collapsed into a 404.

Detection is prefix-only and deliberately so — Connect's real unary content types include application/json, so media-type sniffing would hijack ordinary application routes.

Optional for source compatibility with implementors written before this member existed. The kernel treats an absent claims as "claims nothing" and falls through to its own 404, because silently claiming every unmatched route is the more damaging default.

Parameters

request: Request

The native fetch request

Return Type

boolean

true when the request lies inside this service's base path

Usage

import { type IGrpcService } from "common/src/index.ts";