MCPcopy Index your code
hub / github.com/simstudioai/sim / buildPreflightResponse

Function buildPreflightResponse

apps/sim/proxy.ts:113–118  ·  view source on GitHub ↗

Next's auto-OPTIONS doesn't carry middleware headers, so we answer preflight here.

(policy: CorsPolicy)

Source from the content-addressed store, hash-verified

111
112/** Next's auto-OPTIONS doesn't carry middleware headers, so we answer preflight here. */
113function buildPreflightResponse(policy: CorsPolicy): NextResponse {
114 const response = new NextResponse(null, { status: 204 })
115 applyCorsHeaders(response, policy)
116 response.headers.set('Access-Control-Max-Age', CORS_PREFLIGHT_MAX_AGE)
117 return response
118}
119
120const SUSPICIOUS_UA_PATTERNS = [
121 /^\s*$/, // Empty user agents

Callers 1

proxyFunction · 0.85

Calls 2

applyCorsHeadersFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected