diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-29 09:48:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-29 09:48:19 +0200 |
commit | 3ff5a19b4c988d6c712b7ce63c4cf04f99d047ce (patch) | |
tree | ae0b68e51520768df824a242d2986f4e5fb436f5 | |
parent | 12daa83784ea112e33d3b8b590a805dae9a29c1c (diff) | |
download | PeerTube-3ff5a19b4c988d6c712b7ce63c4cf04f99d047ce.tar.gz PeerTube-3ff5a19b4c988d6c712b7ce63c4cf04f99d047ce.tar.zst PeerTube-3ff5a19b4c988d6c712b7ce63c4cf04f99d047ce.zip |
Do not enable cors twice on /api in test mode
-rw-r--r-- | server.ts | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -90,7 +90,8 @@ if (isTestInstance()) { | |||
90 | // These routes have already cors | 90 | // These routes have already cors |
91 | if ( | 91 | if ( |
92 | req.path.indexOf(STATIC_PATHS.TORRENTS) === -1 && | 92 | req.path.indexOf(STATIC_PATHS.TORRENTS) === -1 && |
93 | req.path.indexOf(STATIC_PATHS.WEBSEED) === -1 | 93 | req.path.indexOf(STATIC_PATHS.WEBSEED) === -1 && |
94 | req.path.startsWith('/api/') === false | ||
94 | ) { | 95 | ) { |
95 | return (cors({ | 96 | return (cors({ |
96 | origin: '*', | 97 | origin: '*', |