MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / isUnauthorizedError

Function isUnauthorizedError

mcp/src/http-server.ts:334–346  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

332}
333
334function isUnauthorizedError(err: unknown): boolean {
335 if (!err || typeof err !== "object") return false;
336 const maybe = err as {
337 status?: unknown;
338 statusCode?: unknown;
339 response?: { status?: unknown };
340 };
341 return (
342 maybe.status === 401
343 || maybe.statusCode === 401
344 || maybe.response?.status === 401
345 );
346}
347
348function extractBearer(req: Request): string | null {
349 const auth = req.headers.authorization;

Callers 1

resolvePrincipalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected