ActivityPub-federated video streaming platform using P2P directly in your web browser
open CORS to allow in-browser apps to communicate w/ PeerTube instances
William Lahti1fd2d96ff81f
diff --git a/server.ts b/server.tsindex 5511c54358..adebd9ce90 100644--- a/server.ts+++ b/server.ts@@ -84,24 +84,22 @@ import { UpdateVideosScheduler } from './server/lib/schedulers/update-videos-sch// ----------- App ------------// 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- ) {- return (cors({- origin: '*',- exposedHeaders: 'Retry-After',- credentials: true- }))(req, res, next)- }-- return next()- })-}+// Enable CORS+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+ ) {+ return (cors({+ origin: '*',+ exposedHeaders: 'Retry-After',+ credentials: true+ }))(req, res, next)+ }++ return next()+});// For the loggerapp.use(morgan('combined', {