Skip to content

Commit

Permalink
fix: Livechat CSP whitelist validation (#29278)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandernsilva authored May 18, 2023
1 parent 3ad30b4 commit 1702461
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-bottles-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fixes the Livechat CSP validation, which was incorrectly blocking access to the widget for all non whitelisted domains
2 changes: 1 addition & 1 deletion apps/meteor/app/livechat/server/livechat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WebApp.connectHandlers.use('/livechat', (req, res, next) => {

const domainWhiteListSetting = settings.get<string>('Livechat_AllowedDomainsList');
let domainWhiteList = [];
if (req.headers.referer && !domainWhiteListSetting.trim()) {
if (req.headers.referer && domainWhiteListSetting.trim()) {
domainWhiteList = domainWhiteListSetting.split(',').map((domain) => domain.trim());

const referer = url.parse(req.headers.referer);
Expand Down

0 comments on commit 1702461

Please sign in to comment.