We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8b99e8 commit 057b3a5Copy full SHA for 057b3a5
pages/api/index.js
@@ -8,11 +8,12 @@ const NODE_ENV = process.env.NODE_ENV
8
const API_ENDPOINT = process.env.API_ENDPOINT || 'https://pro.microlink.io'
9
const API_KEY = process.env.API_KEY
10
11
-const origins = process.env.ORIGINS.split(',').map(n => n.trim())
+const origins = process.env.ORIGINS?.split(',').map(n => n.trim())
12
+
13
const isProduction = NODE_ENV === 'production'
14
15
const isAllowedDomain =
- isProduction && origins.length > 0
16
+ isProduction && Array.isArray(origins)
17
? origin => origins.includes(origin)
18
: () => true
19
0 commit comments