Skip to content

Commit 245f5f2

Browse files
committed
docs: add comment explaining why apikey query parameter needs to be removed
1 parent b27d104 commit 245f5f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
function envoy_on_request(request_handle)
2-
local path = request_handle:headers():get(":path")
2+
local path = request_handle:headers():get(":path")
33

4-
request_handle:headers():replace(":path", path:gsub("([&?])apikey=[^&]+&?", "%1"):gsub("&$", ""))
4+
-- Remove `apikey` query parameter since PostgREST treats query parameters as conditions.
5+
request_handle
6+
:headers()
7+
:replace(":path", path:gsub("([&?])apikey=[^&]+&?", "%1"):gsub("&$", ""))
58
end

0 commit comments

Comments
 (0)