GeezerVison is showing github.com — sync · cavanaug/opencode@1aed6b1
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/console/app/src/routes/zen/util
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/console/app/src/routes/zen/util/handler.ts +7-5Lines changed: 7 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -158,11 +158,13 @@ export async function handler( |
158 | 158 | Object.entries(obj).flatMap(([k, v]) => { |
159 | 159 | if (Array.isArray(v)) return [[k, v]] |
160 | 160 | 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 | + } |
166 | 168 | } |
167 | 169 | return [[k, v]] |
168 | 170 | }), |
|