Skip to content

Commit d0aa035

Browse files
authored
Update rate-limiting.md
1 parent cd891da commit d0aa035

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/security/rate-limiting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ This module can work with websockets, but it requires some class extension. You
104104
export class WsThrottlerGuard extends ThrottlerGuard {
105105
async handleRequest(context: ExecutionContext, limit: number, ttl: number): Promise<boolean> {
106106
const client = context.switchToWs().getClient();
107-
const ip = ['_socket'].shift().remoteAddress;
107+
const ip = client._socket.remoteAddress
108108
const key = this.generateKey(context, ip);
109109
const { totalHits } = await this.storageService.increment(key, ttl);
110110

0 commit comments

Comments
 (0)