mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
Handle single-key wrapped OpenClaw auth headers
This commit is contained in:
parent
70051735f6
commit
0324259da3
2 changed files with 36 additions and 0 deletions
|
|
@ -159,6 +159,22 @@ function normalizeHeaderValue(
|
|||
const normalized = normalizeHeaderValue((value as Record<string, unknown>)[key], depth + 1);
|
||||
if (normalized) return normalized;
|
||||
}
|
||||
|
||||
const entries = Object.entries(value as Record<string, unknown>);
|
||||
if (entries.length === 1) {
|
||||
const [singleKey, singleValue] = entries[0];
|
||||
const normalizedKey = singleKey.trim().toLowerCase();
|
||||
if (
|
||||
normalizedKey !== "type" &&
|
||||
normalizedKey !== "version" &&
|
||||
normalizedKey !== "secretid" &&
|
||||
normalizedKey !== "secret_id"
|
||||
) {
|
||||
const normalized = normalizeHeaderValue(singleValue, depth + 1);
|
||||
if (normalized) return normalized;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue