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

[FIX] Custom Emoji Image preview #24117

Merged

Conversation

sidmohanty11
Copy link
Contributor

@sidmohanty11 sidmohanty11 commented Jan 6, 2022

By using URL.createObjectURL() it produces a blob url which is not present in cors content-security-policy header so, its showing that error.

By making a data url, the image preview works fine.

Proposed changes (including videos or screenshots)

Before,

custom-img-preview-rc3

After,

custom-img-preview-rc1

also if any error, (for example - if we upload a video mp4 file)

custom-img-preview-rc2

Issue(s)

Closes #24082

Steps to test or reproduce

Further comments

@tassoevan
Copy link
Contributor

Unless I'm doing some fundamental mistake, data: and blob: URIs are similar in terms of security, therefore a better correction would be to change the Content Security Policy of img-src to include blob: aside data:.

@sidmohanty11
Copy link
Contributor Author

Done! @tassoevan

@dougfabris dougfabris removed the request for review from tassoevan January 7, 2022 23:23
@dougfabris dougfabris merged commit 85fc2a9 into RocketChat:develop Jan 8, 2022
gabriellsh added a commit that referenced this pull request Jan 17, 2022
…ove/setup-wizard

* 'develop' of github.com:RocketChat/Rocket.Chat: (176 commits)
  [IMPROVE] Admin page header buttons consistency (#24168)
  i18n: Language update from LingoHub 🤖 on 2022-01-17Z (#24193)
  [FIX] Integration section crashing opening in My Account (#24068)
  [IMPROVE] Rewrite roomNotFound to React Component (#24044)
  Regression: Enable custom emoji on admin custom status page (#24186)
  Chore: Update Meteor to 2.5.3 (#24075)
  [NEW] Apple Login (#24060)
  Chore: Update Apps-Engine to 1.29.2 (#24171)
  feat: enabling emoji on custom status (#24170)
  [FIX] App Framework Enable hanging indefinitely (#24158)
  [FIX] CSV Importer failing to import users (#24090)
  Fix Engagement Dashboard API requests (#24142)
  Language update from LingoHub 🤖 (#24127)
  Chore: Migrate useOutsideClick to fuselage-hooks (#24133)
  Revert "Use fibers to store context"
  Use fibers to store context
  Chore: Include REG_TOKEN in docker-compose (#24123)
  [FIX] Custom Emoji Image preview #24117
  [IMPROVE] Added a Reset Button in the Account Profile Page (#24078)
  Revert: "[IMPROVE] Throw 404 error in invalid endpoints" (#24118)
  ...
@sampaiodiego sampaiodiego mentioned this pull request Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Emoji - Failed to load emoji thumbnail after uploaded
3 participants