feat(supabase): SQL gate reports non-http(s) reference urls (reference.url.scheme), pgTAP 008 cases; EVAL-010, journal, TODO 4c
This commit is contained in:
1 parent
34be7e23df
commit
c0c17fcf5f
6 files changed
+32
-3
No files matched your search
@@ -96,6 +96,16 @@ begin
|
||||
) then
|
||||
v_issues := private.append_issue(v_issues, 'region.count_range.invalid');
|
||||
end if;
|
||||
-- Zod refuses non-http(s) reference urls at parse; a document sent straight
|
||||
-- to the RPC must meet the same bar before anything renders it as a link.
|
||||
if exists (
|
||||
select 1
|
||||
from jsonb_array_elements(coalesce(p_doc -> 'references', '[]'::jsonb)) ref
|
||||
where jsonb_typeof(ref -> 'url') = 'string'
|
||||
and (ref ->> 'url') !~ '^https?://'
|
||||
) then
|
||||
v_issues := private.append_issue(v_issues, 'reference.url.scheme');
|
||||
end if;
|
||||
return v_issues;
|
||||
end;
|
||||
$$;
|
||||
|
||||
Reference in new issue
Block a user