mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 06:41:22 +00:00
refactor(gateway): harden proxy client ip resolution
This commit is contained in:
@@ -20,6 +20,7 @@ type OpenAiHttpOptions = {
|
||||
auth: ResolvedGatewayAuth;
|
||||
maxBodyBytes?: number;
|
||||
trustedProxies?: string[];
|
||||
allowRealIpFallback?: boolean;
|
||||
rateLimiter?: AuthRateLimiter;
|
||||
};
|
||||
|
||||
@@ -162,6 +163,7 @@ export async function handleOpenAiHttpRequest(
|
||||
pathname: "/v1/chat/completions",
|
||||
auth: opts.auth,
|
||||
trustedProxies: opts.trustedProxies,
|
||||
allowRealIpFallback: opts.allowRealIpFallback,
|
||||
rateLimiter: opts.rateLimiter,
|
||||
maxBodyBytes: opts.maxBodyBytes ?? 1024 * 1024,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user