MCPcopy Create free account
hub / github.com/DumbWareio/DumbDo / originValidationMiddleware

Function originValidationMiddleware

scripts/cors.js:59–69  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

57}
58
59function originValidationMiddleware(req, res, next) {
60 let origin = req.headers.referer;
61 const isOriginValid = validateOrigin(origin);
62
63 if (isOriginValid) {
64 next();
65 } else {
66 console.warn("Blocked request from origin:", { origin });
67 res.status(403).json({ error: 'Forbidden' });
68 }
69}
70
71
72function getCorsOptions() {

Callers

nothing calls this directly

Calls 1

validateOriginFunction · 0.85

Tested by

no test coverage detected