mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
refactor: trim gateway helper exports
This commit is contained in:
@@ -31,7 +31,7 @@ export function isChatStopCommandText(text: string): boolean {
|
||||
return isAbortRequestText(text);
|
||||
}
|
||||
|
||||
export function resolveChatRunExpiresAtMs(params: {
|
||||
function resolveChatRunExpiresAtMs(params: {
|
||||
now: number;
|
||||
timeoutMs: number;
|
||||
graceMs?: number;
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
export {
|
||||
hasGatewayPasswordEnvCandidate,
|
||||
hasGatewayTokenEnvCandidate,
|
||||
trimCredentialToUndefined,
|
||||
trimToUndefined,
|
||||
} from "./credential-planner.js";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { trimToUndefined, type ExplicitGatewayAuth } from "./credentials.js";
|
||||
|
||||
export function hasExplicitGatewayConnectionAuth(auth?: ExplicitGatewayAuth): boolean {
|
||||
function hasExplicitGatewayConnectionAuth(auth?: ExplicitGatewayAuth): boolean {
|
||||
return Boolean(trimToUndefined(auth?.token) || trimToUndefined(auth?.password));
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ function normalizeTailnetHostForUrl(rawHost: string): string | null {
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
export function buildTailnetHttpsOrigin(rawHost: string): string | null {
|
||||
function buildTailnetHttpsOrigin(rawHost: string): string | null {
|
||||
const normalizedHost = normalizeTailnetHostForUrl(rawHost);
|
||||
if (!normalizedHost) {
|
||||
return null;
|
||||
@@ -55,7 +55,7 @@ export function buildTailnetHttpsOrigin(rawHost: string): string | null {
|
||||
}
|
||||
}
|
||||
|
||||
export function appendAllowedOrigin(existing: string[] | undefined, origin: string): string[] {
|
||||
function appendAllowedOrigin(existing: string[] | undefined, origin: string): string[] {
|
||||
const current = existing ?? [];
|
||||
const normalized = normalizeLowercaseStringOrEmpty(origin);
|
||||
if (current.some((entry) => normalizeLowercaseStringOrEmpty(entry) === normalized)) {
|
||||
|
||||
Reference in New Issue
Block a user