oEmbed API should use CORS (#6562)
* oEmbed API should use CORS * Simplify cors function call --------- Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
parent
82c15dd48e
commit
7de5e13b25
|
@ -1,4 +1,5 @@
|
||||||
import express from 'express'
|
import express from 'express'
|
||||||
|
import cors from 'cors'
|
||||||
import { escapeHTML, forceNumber } from '@peertube/peertube-core-utils'
|
import { escapeHTML, forceNumber } from '@peertube/peertube-core-utils'
|
||||||
import { MChannelSummary } from '@server/types/models/index.js'
|
import { MChannelSummary } from '@server/types/models/index.js'
|
||||||
import { EMBED_SIZE, PREVIEWS_SIZE, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants.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()
|
const servicesRouter = express.Router()
|
||||||
|
|
||||||
servicesRouter.use('/oembed',
|
servicesRouter.use('/oembed',
|
||||||
|
cors(),
|
||||||
apiRateLimiter,
|
apiRateLimiter,
|
||||||
asyncMiddleware(oembedValidator),
|
asyncMiddleware(oembedValidator),
|
||||||
generateOEmbed
|
generateOEmbed
|
||||||
|
|
Loading…
Reference in New Issue