melishev / strapi-plugin-react-editorjs

📝 Plugin for Strapi Headless CMS, hiding the standard WYSIWYG editor on Editor.js
https://www.npmjs.com/package/strapi-plugin-react-editorjs
MIT License
170 stars 77 forks source link

Embed and Link - This content is blocked #38

Closed gregghawes closed 2 years ago

gregghawes commented 2 years ago

I can't seem to get the embed or link functions to work. Screenshot_1

The embed element just shows "This content is blocked. Contact the site owner to fix the issue."

When I try to add a link, an error pops up saying "Couldn't fetch the link data" and I notice a 404 shows in the console.

http: GET /api/react-editorjs/link?url=https%3A%2F%2Fwww.google.co.uk%2F (1 ms) 404

"@strapi/strapi": "4.1.7", "strapi-plugin-react-editorjs": "^2.0.0"

melishev commented 2 years ago

@gregghawes did you follow the instructions to enable Link functionality?

gregghawes commented 2 years ago

I added the 'img-src': ['*'], to middlewares.js. Are there other instructions that I am missing?

gregghawes commented 2 years ago

This is my middlewares.js @melishev

module.exports = [
  'strapi::errors',
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        directives: {
          'img-src': ['*'],
        },
      }
    },
  },
  'strapi::cors',
  'strapi::poweredBy',
  'strapi::logger',
  'strapi::query',
  'strapi::body',
  'strapi::session',
  'strapi::favicon',
  'strapi::public',
];
melishev commented 2 years ago

Well, the last PR https://github.com/melishev/strapi-plugin-react-editorjs/pull/44 should solve your problem, thanks for the input - @nhvu1988