Refactor default headers to be injected dynamically (#367)

This commit is contained in:
Gregory Schier
2026-01-19 07:29:00 -08:00
committed by GitHub
parent 1893b8f8dd
commit beb47a6b6a
13 changed files with 106 additions and 33 deletions

View File

@@ -0,0 +1,12 @@
-- Filter out headers that match the hardcoded defaults (User-Agent: yaak, Accept: */*),
-- keeping any other custom headers the user may have added.
UPDATE workspaces
SET headers = (
SELECT json_group_array(json(value))
FROM json_each(headers)
WHERE NOT (
(LOWER(json_extract(value, '$.name')) = 'user-agent' AND json_extract(value, '$.value') = 'yaak')
OR (LOWER(json_extract(value, '$.name')) = 'accept' AND json_extract(value, '$.value') = '*/*')
)
)
WHERE json_array_length(headers) > 0;