Fix empty headers being added on POST/PATCH/DELETE (#1458)
This commit is contained in:
Vendored
+1
@@ -121,6 +121,7 @@ GRANT ALL ON TABLE
|
||||
, activities
|
||||
, unit_workdays
|
||||
, stuff
|
||||
, loc_test
|
||||
TO postgrest_test_anonymous;
|
||||
|
||||
GRANT INSERT ON TABLE insertonly TO postgrest_test_anonymous;
|
||||
|
||||
Vendored
+6
-1
@@ -1681,10 +1681,15 @@ begin
|
||||
perform set_config(
|
||||
'response.headers'
|
||||
, format('[{"Location": "/%s?id=eq.%s&overriden=true"}]', tg_table_name, new.id)
|
||||
, false
|
||||
, true
|
||||
);
|
||||
end if;
|
||||
return new;
|
||||
end
|
||||
$$ language plpgsql security definer;
|
||||
create trigger location_for_stuff instead of insert on test.stuff for each row execute procedure test.location_for_stuff();
|
||||
|
||||
create table loc_test (
|
||||
id int primary key
|
||||
, c text
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user