aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorWilliam Lahti <wilahti@gmail.com>2018-06-28 20:23:26 -0700
committerChocobozzz <me@florianbigard.com>2018-06-29 09:46:44 +0200
commit12daa83784ea112e33d3b8b590a805dae9a29c1c (patch)
tree1b2939ea315f9447edff140f221b396d3334cb20 /server/controllers/api
parentb229e38d50c43221b8fa21cf7c778212f2742e93 (diff)
downloadPeerTube-12daa83784ea112e33d3b8b590a805dae9a29c1c.tar.gz
PeerTube-12daa83784ea112e33d3b8b590a805dae9a29c1c.tar.zst
PeerTube-12daa83784ea112e33d3b8b590a805dae9a29c1c.zip
move CORS allowance to the REST API router
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/index.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts
index 8f63b9535..c386a6710 100644
--- a/server/controllers/api/index.ts
+++ b/server/controllers/api/index.ts
@@ -8,9 +8,16 @@ import { accountsRouter } from './accounts'
8import { videosRouter } from './videos' 8import { videosRouter } from './videos'
9import { badRequest } from '../../helpers/express-utils' 9import { badRequest } from '../../helpers/express-utils'
10import { videoChannelRouter } from './video-channel' 10import { videoChannelRouter } from './video-channel'
11import * as cors from 'cors'
11 12
12const apiRouter = express.Router() 13const apiRouter = express.Router()
13 14
15apiRouter.use(cors({
16 origin: '*',
17 exposedHeaders: 'Retry-After',
18 credentials: true
19}))
20
14apiRouter.use('/server', serverRouter) 21apiRouter.use('/server', serverRouter)
15apiRouter.use('/oauth-clients', oauthClientsRouter) 22apiRouter.use('/oauth-clients', oauthClientsRouter)
16apiRouter.use('/config', configRouter) 23apiRouter.use('/config', configRouter)