Skip to content

Commit

Permalink
fix: return an empty list if is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo committed Jan 29, 2024
1 parent d98b65c commit af052b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/controllers/secret.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async function secret(fastify) {
const where = { isPublic: true };

if (username && !validUsername.test(username)) {
return reply.code(403).send({ error: 'Not a valid username' });
return reply.code(403).send([]);
} else {
where.user = { username };
}
Expand Down

0 comments on commit af052b7

Please sign in to comment.