sync
This commit is contained in:
parent
c1f607d206
commit
1aed6b1d8b
1 changed files with 7 additions and 5 deletions
|
|
@ -158,11 +158,13 @@ export async function handler(
|
||||||
Object.entries(obj).flatMap(([k, v]) => {
|
Object.entries(obj).flatMap(([k, v]) => {
|
||||||
if (Array.isArray(v)) return [[k, v]]
|
if (Array.isArray(v)) return [[k, v]]
|
||||||
if (typeof v === "object") return [[k, replacer(v)]]
|
if (typeof v === "object") return [[k, replacer(v)]]
|
||||||
if (v === "$ip") return [[k, ip]]
|
if (typeof v === "string") {
|
||||||
if (v === "$workspace") return authInfo?.workspaceID ? [[k, authInfo?.workspaceID]] : []
|
if (v === "$ip") return [[k, ip]]
|
||||||
if (v.startsWith("$header.")) {
|
if (v === "$workspace") return authInfo?.workspaceID ? [[k, authInfo?.workspaceID]] : []
|
||||||
const headerValue = input.request.headers.get(v.slice(8))
|
if (v.startsWith("$header.")) {
|
||||||
return headerValue ? [[k, headerValue]] : []
|
const headerValue = input.request.headers.get(v.slice(8))
|
||||||
|
return headerValue ? [[k, headerValue]] : []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return [[k, v]]
|
return [[k, v]]
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue