zen: remove header check
This commit is contained in:
parent
342436dfc4
commit
a8fd0159be
2 changed files with 2 additions and 5 deletions
|
|
@ -17,9 +17,8 @@ export function createRateLimiter(
|
||||||
const dict = i18n(localeFromRequest(request))
|
const dict = i18n(localeFromRequest(request))
|
||||||
|
|
||||||
const limits = Subscription.getFreeLimits()
|
const limits = Subscription.getFreeLimits()
|
||||||
const headerExists = request.headers.has(limits.checkHeader)
|
const dailyLimit = rateLimit ?? limits.dailyRequests
|
||||||
const dailyLimit = !headerExists ? limits.fallbackValue : (rateLimit ?? limits.dailyRequests)
|
const isDefaultModel = !rateLimit
|
||||||
const isDefaultModel = headerExists && !rateLimit
|
|
||||||
|
|
||||||
const ip = !rawIp.length ? "unknown" : rawIp
|
const ip = !rawIp.length ? "unknown" : rawIp
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@ export namespace Subscription {
|
||||||
free: z.object({
|
free: z.object({
|
||||||
promoTokens: z.number().int(),
|
promoTokens: z.number().int(),
|
||||||
dailyRequests: z.number().int(),
|
dailyRequests: z.number().int(),
|
||||||
checkHeader: z.string(),
|
|
||||||
fallbackValue: z.number().int(),
|
|
||||||
}),
|
}),
|
||||||
lite: z.object({
|
lite: z.object({
|
||||||
rollingLimit: z.number().int(),
|
rollingLimit: z.number().int(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue