Skip to content

[FIX] Custom Emoji Image preview#24117

Merged
dougfabris merged 2 commits intoRocketChat:developfrom
sidmohanty11:custom-emoji-preview-img
Jan 8, 2022
Merged

[FIX] Custom Emoji Image preview#24117
dougfabris merged 2 commits intoRocketChat:developfrom
sidmohanty11:custom-emoji-preview-img

Conversation

@sidmohanty11
Copy link
Copy Markdown
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
Copy Markdown
Member

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 sidmohanty11 force-pushed the custom-emoji-preview-img branch from 041caf3 to df76d75 Compare January 7, 2022 04:31
@sidmohanty11
Copy link
Copy Markdown
Contributor Author

Done! @tassoevan

@dougfabris dougfabris requested a review from tassoevan January 7, 2022 23:22
@dougfabris dougfabris removed the request for review from tassoevan January 7, 2022 23:23
@dougfabris dougfabris added the area: ui/ux Related to UI/UX, frontend code, accessibility, and user interaction label Jan 7, 2022
@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

area: ui/ux Related to UI/UX, frontend code, accessibility, and user interaction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Emoji - Failed to load emoji thumbnail after uploaded

3 participants