Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

oEmbed API should use CORS (#6562)

David Baumgold7de5e13b250a
diff --git a/server/core/controllers/services.ts b/server/core/controllers/services.ts
index f84f2cffea..bb107076dc 100644
--- a/server/core/controllers/services.ts
+++ b/server/core/controllers/services.ts
@@ -1,4 +1,5 @@
import express from 'express'
+import cors from 'cors'
import { escapeHTML, forceNumber } from '@peertube/peertube-core-utils'
import { MChannelSummary } from '@server/types/models/index.js'
import { EMBED_SIZE, PREVIEWS_SIZE, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants.js'
@@ -8,6 +9,7 @@ import { accountNameWithHostGetValidator } from '../middlewares/validators/index
const servicesRouter = express.Router()
servicesRouter.use('/oembed',
+ cors(),
apiRateLimiter,
asyncMiddleware(oembedValidator),
generateOEmbed