fix: preserve PostgREST RPC path through DWH proxy
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user