MCPcopy Index your code
hub / github.com/CodeGraphContext/CodeGraphContext / isAllowedOrigin

Function isAllowedOrigin

website/api/lib/security.js:131–147  ·  view source on GitHub ↗
(originHeader)

Source from the content-addressed store, hash-verified

129}
130
131function isAllowedOrigin(originHeader) {
132 const allowListRaw = process.env.BUNDLE_TRIGGER_ALLOWED_ORIGINS;
133 if (!allowListRaw || allowListRaw.trim().length === 0) {
134 return true;
135 }
136
137 if (!originHeader || typeof originHeader !== "string") {
138 return false;
139 }
140
141 const allowedOrigins = allowListRaw
142 .split(",")
143 .map((origin) => origin.trim())
144 .filter(Boolean);
145
146 return allowedOrigins.includes(originHeader);
147}
148
149function isAuthorizedRequest(req) {
150 const expectedApiKey = process.env.BUNDLE_TRIGGER_API_KEY;

Callers 1

handlerFunction · 0.90

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected