Fix unknown function ends_with in pg

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-07 11:14:21 +04:00
parent 3e4b4eec78
commit 8393e4bfb1
2 changed files with 3 additions and 3 deletions

View File

@@ -541,12 +541,12 @@ func reportDetectedCookies(t *testing.T, c *testutil.Client, bannerID string, na
body, err := json.Marshal(map[string]any{"cookies": cookies})
require.NoError(t, err)
endpoint := fmt.Sprintf("%s/api/cookie-banner/v1/%s/detected-cookies", c.BaseURL(), bannerID)
endpoint := fmt.Sprintf("%s/api/cookie-banner/v1/%s/report", c.BaseURL(), bannerID)
resp, err := c.HTTPClient().Post(endpoint, "application/json", bytes.NewReader(body))
require.NoError(t, err)
defer func() { _ = resp.Body.Close() }()
require.Equal(t, http.StatusNoContent, resp.StatusCode,
"detected-cookies endpoint should return 204")
"report endpoint should return 204")
}
func TestCookieBannerVersioning_DetectedCookiesNeverBump(t *testing.T) {

View File

@@ -241,7 +241,7 @@ WHERE
AND (
(match_type = @match_type_glob
AND starts_with(@identifier, split_part(pattern, '*', 1))
AND ends_with(@identifier, split_part(pattern, '*', 2))
AND right(@identifier, length(split_part(pattern, '*', 2))) = split_part(pattern, '*', 2)
AND length(@identifier) >= length(pattern) - 1)
OR (match_type = @match_type_exact AND pattern = @identifier)
)