mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
Bugfix/Regex check for auth middleware (#2469)
add regex check for auth middleware
This commit is contained in:
@@ -140,8 +140,8 @@ export class App {
|
||||
'/api/v1/ip'
|
||||
]
|
||||
this.app.use((req, res, next) => {
|
||||
if (req.url.includes('/api/v1/')) {
|
||||
whitelistURLs.some((url) => req.url.includes(url)) ? next() : basicAuthMiddleware(req, res, next)
|
||||
if (/\/api\/v1\//i.test(req.url)) {
|
||||
whitelistURLs.some((url) => new RegExp(url, 'i').test(req.url)) ? next() : basicAuthMiddleware(req, res, next)
|
||||
} else next()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ const logger = createLogger({
|
||||
* this.app.use(expressRequestLogger)
|
||||
*/
|
||||
export function expressRequestLogger(req: Request, res: Response, next: NextFunction): void {
|
||||
const unwantedLogURLs = ['/api/v1/node-icon/']
|
||||
if (req.url.includes('/api/v1/') && !unwantedLogURLs.some((url) => req.url.includes(url))) {
|
||||
const unwantedLogURLs = ['/api/v1/node-icon/', '/api/v1/components-credentials-icon/']
|
||||
if (/\/api\/v1\//i.test(req.url) && !unwantedLogURLs.some((url) => new RegExp(url, 'i').test(req.url))) {
|
||||
const fileLogger = createLogger({
|
||||
format: combine(timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), format.json(), errors({ stack: true })),
|
||||
defaultMeta: {
|
||||
|
||||
Reference in New Issue
Block a user