Skip to content

Commit

Permalink
regression: allow specific routes to receive query attr (#33691)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogarim authored Oct 22, 2024
1 parent ce283bf commit a46dbfd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/meteor/app/api/server/helpers/parseJsonQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,16 @@ export async function parseJsonQuery(api: PartialThis): Promise<{
}
}

const allowedRoutes = [
'/api/v1/settings.public',
'/api/v1/directory',
'/api/v1/channels.messages',
'/api/v1/groups.messages',
'/api/v1/dm.messages',
'/api/v1/im.messages',
];
let query: Record<string, any> = {};
if (params.query && isUnsafeQueryParamsAllowed) {
if (params.query && (isUnsafeQueryParamsAllowed || allowedRoutes.includes(route))) {
apiDeprecationLogger.parameter(route, 'query', '8.0.0', response, messageGenerator);
try {
query = ejson.parse(params.query);
Expand Down

0 comments on commit a46dbfd

Please sign in to comment.