simple-image icon indicating copy to clipboard operation
simple-image copied to clipboard

Feature request: An option to allow only https

Open akalineskou opened this issue 5 years ago • 1 comments

We don't want to allow someone to add images to non secure urls.

This should be the default IMO, and if someone wants to allow it, they can enable allowHttp or something along those lines.

akalineskou avatar Feb 02 '21 14:02 akalineskou

You can fork this repo and modify the paste regex pattern:

Default:

  static get pasteConfig() {
    return {
      patterns: {
        image: /https?:\/\/\S+\.(gif|jpe?g|tiff|png|webp)$/i,
      },
      tags: ['img'],
      files: {
        mimeTypes: ['image/*'],
      },
    };
  }

Allow only https:

  static get pasteConfig() {
    return {
      patterns: {
        image: /https:\/\/\S+\.(gif|jpe?g|tiff|png|webp)$/i,
      },
      tags: ['img'],
      files: {
        mimeTypes: ['image/*'],
      },
    };
  }

zignis avatar Feb 02 '22 07:02 zignis