mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-19 16:21:13 +01:00
16 lines
696 B
SQL
16 lines
696 B
SQL
-- Add default User-Agent header to workspaces that don't already have one (case-insensitive check)
|
|
UPDATE workspaces
|
|
SET headers = json_insert(headers, '$[#]', json('{"enabled":true,"name":"User-Agent","value":"yaak"}'))
|
|
WHERE NOT EXISTS (
|
|
SELECT 1 FROM json_each(workspaces.headers)
|
|
WHERE LOWER(json_extract(value, '$.name')) = 'user-agent'
|
|
);
|
|
|
|
-- Add default Accept header to workspaces that don't already have one (case-insensitive check)
|
|
UPDATE workspaces
|
|
SET headers = json_insert(headers, '$[#]', json('{"enabled":true,"name":"Accept","value":"*/*"}'))
|
|
WHERE NOT EXISTS (
|
|
SELECT 1 FROM json_each(workspaces.headers)
|
|
WHERE LOWER(json_extract(value, '$.name')) = 'accept'
|
|
);
|