Skip to content

Commit

Permalink
fix: added toLowerCase for safeguard string comparison on RCPT TO
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Apr 7, 2023
1 parent 5fdda70 commit a4e8a69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/controllers/web/my-account/list-logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ async function listLogs(ctx) {
let isAdmin = false;
const match = log.domains.find((logDomain) => {
const find = ctx.state.domains.find(
(d) => d.id === logDomain.toString() && d.name === domain
(d) =>
d.id === logDomain.toString() &&
d.name === domain.toLowerCase()
);
if (!find) return false;
if (find.group === 'admin') isAdmin = true;
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/web/my-account/retrieve-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ async function retrieveLog(ctx, next) {
let isAdmin = false;
const match = log.domains.find((logDomain) => {
const find = ctx.state.domains.find(
(d) => d.id === logDomain.toString() && d.name === domain
(d) =>
d.id === logDomain.toString() && d.name === domain.toLowerCase()
);
if (!find) return false;
if (find.group === 'admin') isAdmin = true;
Expand Down

0 comments on commit a4e8a69

Please sign in to comment.