MCPcopy Create free account
hub / github.com/evolution-foundation/evolution-api / origin

Function origin

src/main.ts:49–58  ·  view source on GitHub ↗
(requestOrigin, callback)

Source from the content-addressed store, hash-verified

47 app.use(
48 cors({
49 origin(requestOrigin, callback) {
50 const { ORIGIN } = configService.get<Cors>('CORS');
51 if (ORIGIN.includes('*')) {
52 return callback(null, true);
53 }
54 if (ORIGIN.indexOf(requestOrigin) !== -1) {
55 return callback(null, true);
56 }
57 return callback(new Error('Not allowed by CORS'));
58 },
59 methods: [...configService.get<Cors>('CORS').METHODS],
60 credentials: configService.get<Cors>('CORS').CREDENTIALS,
61 }),

Callers

nothing calls this directly

Calls 1

getMethod · 0.65

Tested by

no test coverage detected