Skip to content

Commit 1aed6b1

Browse files
committed
sync
1 parent c1f607d commit 1aed6b1

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

  • packages/console/app/src/routes/zen/util

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,13 @@ export async function handler(
158158
Object.entries(obj).flatMap(([k, v]) => {
159159
if (Array.isArray(v)) return [[k, v]]
160160
if (typeof v === "object") return [[k, replacer(v)]]
161-
if (v === "$ip") return [[k, ip]]
162-
if (v === "$workspace") return authInfo?.workspaceID ? [[k, authInfo?.workspaceID]] : []
163-
if (v.startsWith("$header.")) {
164-
const headerValue = input.request.headers.get(v.slice(8))
165-
return headerValue ? [[k, headerValue]] : []
161+
if (typeof v === "string") {
162+
if (v === "$ip") return [[k, ip]]
163+
if (v === "$workspace") return authInfo?.workspaceID ? [[k, authInfo?.workspaceID]] : []
164+
if (v.startsWith("$header.")) {
165+
const headerValue = input.request.headers.get(v.slice(8))
166+
return headerValue ? [[k, headerValue]] : []
167+
}
166168
}
167169
return [[k, v]]
168170
}),

0 commit comments

Comments
 (0)