From 10f934b6c555b9c77e2c5e1a1443115d04bbfbb8 Mon Sep 17 00:00:00 2001 From: Daniel Holmgren Date: Tue, 5 Dec 2023 17:18:24 -0600 Subject: [PATCH] Appview rate limits parse cidr block (#1932) appview rate limits parse cidr block --- packages/bsky/src/config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bsky/src/config.ts b/packages/bsky/src/config.ts index c04eef6c63c..04134e69e21 100644 --- a/packages/bsky/src/config.ts +++ b/packages/bsky/src/config.ts @@ -121,7 +121,9 @@ export class ServerConfig { const rateLimitsEnabled = process.env.RATE_LIMITS_ENABLED === 'true' const rateLimitBypassKey = process.env.RATE_LIMIT_BYPASS_KEY const rateLimitBypassIps = process.env.RATE_LIMIT_BYPASS_IPS - ? process.env.RATE_LIMIT_BYPASS_IPS.split(',') + ? process.env.RATE_LIMIT_BYPASS_IPS.split(',').map((ipOrCidr) => + ipOrCidr.split('/')[0]?.trim(), + ) : undefined return new ServerConfig({