message: feat(server): permissive CORS settings for preview service endpoints
diff: @@ -22,6 +22,8 @@ const { moduleLogger, logger } = require('@/logging/logging')
  const httpErrorImage = (httpErrorCode) =>
  require.resolve(`#/assets/previews/images/preview_${httpErrorCode}.png`)
  +const cors = require('cors')
  +
  const noPreviewImage = require.resolve('#/assets/previews/images/no_preview.png')
  const previewErrorImage = require.resolve('#/assets/previews/images/preview_error.png')
  @@ -153,7 +155,7 @@ exports.init = (app) => {
  return { hasPermissions: true, httpErrorCode: 200 }
  }
  - app.get('/preview/:streamId/:angle?', async (req, res) => {
  + app.get('/preview/:streamId/:angle?', cors(), async (req, res) => {
  const { hasPermissions, httpErrorCode } = await checkStreamPermissions(req)
  if (!hasPermissions) {
  // return res.status( httpErrorCode ).end()
  @@ -179,7 +181,10 @@ exports.init = (app) => {
  )
  })
  - app.get('/preview/:streamId/branches/:branchName/:angle?', async (req, res) => {
  + app.get(
  + '/preview/:streamId/branches/:branchName/:angle?',
  + cors(),
  + async (req, res) => {
  const { hasPermissions, httpErrorCode } = await checkStreamPermissions(req)
  if (!hasPermissions) {
  // return res.status( httpErrorCode ).end()
  @@ -209,9 +214,10 @@ exports.init = (app) => {
  lastCommit.referencedObject,
  req.params.angle || DEFAULT_ANGLE
  )
  - })
  + }
  + )
  - app.get('/preview/:streamId/commits/:commitId/:angle?', async (req, res) => {
  + app.get('/preview/:streamId/commits/:commitId/:angle?', cors(), async (req, res) => {
  const { hasPermissions, httpErrorCode } = await checkStreamPermissions(req)
  if (!hasPermissions) {
  // return res.status( httpErrorCode ).end()
  @@ -233,7 +239,7 @@ exports.init = (app) => {
  )
  })
  - app.get('/preview/:streamId/objects/:objectId/:angle?', async (req, res) => {
  + app.get('/preview/:streamId/objects/:objectId/:angle?', cors(), async (req, res) => {
  const { hasPermissions } = await checkStreamPermissions(req)
  if (!hasPermissions) {
  // return res.status( httpErrorCode ).end()
  