Drop leftover /trust path prefix handling

Portals are host-routed on slug subdomains, so SEO path
stripping and the frontend basename helper were dead code.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-07-21 18:23:06 +02:00
parent 48c7585797
commit e4260d50d3
5 changed files with 26 additions and 78 deletions

View File

@@ -32,12 +32,19 @@ import (
func TestSEOFromRequest(t *testing.T) {
t.Parallel()
req, err := http.NewRequest(http.MethodGet, "https://app.example.com/trust/acme/fr/documents", nil)
req, err := http.NewRequest(
http.MethodGet,
"https://acme.probopage.localhost/fr/documents",
nil,
)
require.NoError(t, err)
lang, canonical, hreflang := complianceportal_v1.SEOFromRequest(req, "https://app.example.com/trust/acme")
lang, canonical, hreflang := complianceportal_v1.SEOFromRequest(
req,
"https://acme.probopage.localhost",
)
assert.Equal(t, "fr", lang)
assert.Equal(t, "https://app.example.com/trust/acme/fr/documents", canonical)
assert.Equal(t, "https://acme.probopage.localhost/fr/documents", canonical)
require.NotEmpty(t, hreflang)
var xDefault string
@@ -50,6 +57,6 @@ func TestSEOFromRequest(t *testing.T) {
enHref = link.Href
}
}
assert.Equal(t, "https://app.example.com/trust/acme/en/documents", enHref)
assert.Equal(t, "https://acme.probopage.localhost/en/documents", enHref)
assert.Equal(t, enHref, xDefault)
}