aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts34
1 files changed, 16 insertions, 18 deletions
diff --git a/server.ts b/server.ts
index 5511c5435..adebd9ce9 100644
--- a/server.ts
+++ b/server.ts
@@ -84,24 +84,22 @@ import { UpdateVideosScheduler } from './server/lib/schedulers/update-videos-sch
84 84
85// ----------- App ----------- 85// ----------- App -----------
86 86
87// Enable CORS for develop 87// Enable CORS
88if (isTestInstance()) { 88app.use((req, res, next) => {
89 app.use((req, res, next) => { 89 // These routes have already cors
90 // These routes have already cors 90 if (
91 if ( 91 req.path.indexOf(STATIC_PATHS.TORRENTS) === -1 &&
92 req.path.indexOf(STATIC_PATHS.TORRENTS) === -1 && 92 req.path.indexOf(STATIC_PATHS.WEBSEED) === -1
93 req.path.indexOf(STATIC_PATHS.WEBSEED) === -1 93 ) {
94 ) { 94 return (cors({
95 return (cors({ 95 origin: '*',
96 origin: '*', 96 exposedHeaders: 'Retry-After',
97 exposedHeaders: 'Retry-After', 97 credentials: true
98 credentials: true 98 }))(req, res, next)
99 }))(req, res, next) 99 }
100 } 100
101 101 return next()
102 return next() 102});
103 })
104}
105 103
106// For the logger 104// For the logger
107app.use(morgan('combined', { 105app.use(morgan('combined', {