105 }
106
107 const headers = getHeaders(cacheLength)
108 const origin = request.headers.get('origin') || '';109 try {
110 if (!ALLOWED_DOMAINS.includes(origin)) {
111 console.log(`Should 403, because origin is not in allowed domains. Origin is "${origin}" and ALLOWED_DOMAINS include`, ALLOWED_DOMAINS)
Expressions that consistently result in either true or false when comparing values, and logical operations like ||, &&, and ?? that consistently either skip or fully evaluate their operands, often indicate mistakes. Logical operations that always yield the same result could lead to unexpected behavior or bugs in the program.
const arrIsEmpty = someArr === [] // Will always evaluate to false
const arrIsEmpty = someArr.length === 0