fix: preserve PostgREST RPC path through DWH proxy

This commit is contained in:
User
2026-08-21 04:40:31 +02:00
parent 707c13d781
commit f616aab542
5 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -105,7 +105,7 @@ check_templates() {
contains_exactly_once "$dwh_lines" 'proxy_set_header X-API-Key "";' || return 1
contains_exactly_once "$dwh_lines" 'proxy_set_header X-DWH-Key-ID "";' || return 1
contains_exactly_once "$dwh_lines" 'proxy_set_header Host $host;' || return 1
contains_exactly_once "$dwh_lines" 'proxy_pass http://127.0.0.1:3001;' || return 1
contains_exactly_once "$dwh_lines" 'proxy_pass http://127.0.0.1:3001/;' || return 1
contains_exactly_once "$http_lines" 'map $http_x_api_key $dwh_public_key_class {' || return 1
contains_line "$http_lines" 'default opaque;' || return 1
@@ -172,7 +172,7 @@ expect_postgrest_regex_bypass_rejected() {
mkdir -- "$fixture"
cp -- "$http_template" "$fixture/http.conf"
cp -- "$location_template" "$fixture/location.conf"
printf "%s\n" "location ~ ^/dwh/ {" " proxy_pass http://127.0.0.1:3001;" "}" >>"$fixture/location.conf"
printf "%s\n" "location ~ ^/dwh/ {" " proxy_pass http://127.0.0.1:3001/;" "}" >>"$fixture/location.conf"
! check_templates "$fixture/http.conf" "$fixture/location.conf"
}
@@ -181,7 +181,7 @@ expect_postgrest_duplicate_bypass_rejected() {
mkdir -- "$fixture"
cp -- "$http_template" "$fixture/http.conf"
cp -- "$location_template" "$fixture/location.conf"
printf "%s\n" "location /dwh/ {" " proxy_pass http://127.0.0.1:3001;" "}" >>"$fixture/location.conf"
printf "%s\n" "location /dwh/ {" " proxy_pass http://127.0.0.1:3001/;" "}" >>"$fixture/location.conf"
! check_templates "$fixture/http.conf" "$fixture/location.conf"
}