// Enable CORS for develop
if (isTestInstance()) {
- app.use((req, res, next) => {
- // These routes have already cors
- if (
- req.path.indexOf(STATIC_PATHS.TORRENTS) === -1 &&
- req.path.indexOf(STATIC_PATHS.WEBSEED) === -1 &&
- req.path.startsWith('/api/') === false
- ) {
- return (cors({
- origin: '*',
- exposedHeaders: 'Retry-After',
- credentials: true
- }))(req, res, next)
- }
-
- return next()
- })
+ app.use(cors({
+ origin: '*',
+ exposedHeaders: 'Retry-After',
+ credentials: true
+ }))
}
// For the logger