MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isSameOriginPost

Function isSameOriginPost

telemetry-dashboard/src/auth.ts:165–173  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

163 * cross-site POST; this is the belt to that pair of braces.
164 */
165export function isSameOriginPost(request: Request): boolean {
166 const origin = request.headers.get('origin');
167 if (!origin) return true; // Absent on some legitimate non-browser clients (curl).
168 try {
169 return new URL(origin).host === new URL(request.url).host;
170 } catch {
171 return false;
172 }
173}

Callers 2

handleLoginSubmitFunction · 0.90
fetchFunction · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected