Explorar o código

zen: remove header check

Frank hai 2 semanas
pai
achega
a8fd0159be

+ 2 - 3
packages/console/app/src/routes/zen/util/rateLimiter.ts

@@ -17,9 +17,8 @@ export function createRateLimiter(
   const dict = i18n(localeFromRequest(request))
 
   const limits = Subscription.getFreeLimits()
-  const headerExists = request.headers.has(limits.checkHeader)
-  const dailyLimit = !headerExists ? limits.fallbackValue : (rateLimit ?? limits.dailyRequests)
-  const isDefaultModel = headerExists && !rateLimit
+  const dailyLimit = rateLimit ?? limits.dailyRequests
+  const isDefaultModel = !rateLimit
 
   const ip = !rawIp.length ? "unknown" : rawIp
   const now = Date.now()

+ 0 - 2
packages/console/core/src/subscription.ts

@@ -9,8 +9,6 @@ export namespace Subscription {
     free: z.object({
       promoTokens: z.number().int(),
       dailyRequests: z.number().int(),
-      checkHeader: z.string(),
-      fallbackValue: z.number().int(),
     }),
     lite: z.object({
       rollingLimit: z.number().int(),