Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: An option to allow only https #34

Open
akalineskou opened this issue Feb 2, 2021 · 1 comment
Open

Feature request: An option to allow only https #34

akalineskou opened this issue Feb 2, 2021 · 1 comment

Comments

@akalineskou
Copy link

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.

@zignis
Copy link

zignis commented Feb 2, 2022

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/*'],
      },
    };
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants