Skip to content

Commit 1693663

Browse files
fix: REST api v1 not enforcing rate limiter (RocketChat#36313)
1 parent 6f4429f commit 1693663

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/proud-wolves-scream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket.chat/meteor': patch
3+
---
4+
5+
Fixes rate limiter not being enforced for the v1 REST API

apps/meteor/app/api/server/ApiClass.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ export class APIClass<
525525
invocation.twoFactorChecked = true;
526526
}
527527

528-
protected getFullRouteName(route: string, method: string): string {
528+
public getFullRouteName(route: string, method: string): string {
529529
return `/${this.apiPath || ''}/${route}${method}`;
530530
}
531531

@@ -831,7 +831,7 @@ export class APIClass<
831831

832832
const objectForRateLimitMatch = {
833833
IPAddr: this.requestIp,
834-
route: `/${route}${this.request.method.toLowerCase()}`,
834+
route: api.getFullRouteName(route, this.request.method.toLowerCase()),
835835
};
836836

837837
let result;

0 commit comments

Comments
 (0)