mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Update condition for checking allowed origins
This commit is contained in:
@@ -1224,12 +1224,11 @@ export class App {
|
|||||||
})
|
})
|
||||||
if (!chatflow) return res.status(404).send(`Chatflow ${req.params.id} not found`)
|
if (!chatflow) return res.status(404).send(`Chatflow ${req.params.id} not found`)
|
||||||
let isDomainAllowed = true
|
let isDomainAllowed = true
|
||||||
logger.debug(`[server]: Request originated from ${req.headers.host}`)
|
logger.info(`[server]: Request originated from ${req.headers.host}`)
|
||||||
if (chatflow.chatbotConfig) {
|
if (chatflow.chatbotConfig) {
|
||||||
const parsedConfig = JSON.parse(chatflow.chatbotConfig)
|
const parsedConfig = JSON.parse(chatflow.chatbotConfig)
|
||||||
logger.debug(`[server]: Chatflow ${req.params.id} has config ${chatflow.chatbotConfig}`)
|
if (parsedConfig.allowedOrigins && parsedConfig.allowedOrigins.length > 0) {
|
||||||
if (parsedConfig.allowedDomains && parsedConfig.allowedDomains.length > 0) {
|
isDomainAllowed = parsedConfig.allowedOrigins.includes(req.headers.host)
|
||||||
isDomainAllowed = parsedConfig.allowedDomains.includes(req.headers.host)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user