Read portal SEO origin from request context

SNI middleware already stores scheme://host; SEOFromRequest
no longer takes a base URL or re-strips the path. Expose
context helpers and drop the obsolete strip tests.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-07-22 12:19:25 +02:00
parent 9ee0df4d3f
commit 52310dbf65
5 changed files with 57 additions and 115 deletions

View File

@@ -38,7 +38,17 @@ func CompliancePortalFromContext(ctx context.Context) *coredata.CompliancePortal
return page
}
func ContextWithCompliancePortal(ctx context.Context, page *coredata.CompliancePortal) context.Context {
return context.WithValue(ctx, compliancePortalKey, page)
}
func CompliancePortalBaseURLFromContext(ctx context.Context) *string {
page, _ := ctx.Value(compliancePortalBaseURLKey).(*string)
return page
}
// ContextWithCompliancePortalBaseURL stores the portal origin (scheme://host).
// Callers must not include a path — consumers append their own routes.
func ContextWithCompliancePortalBaseURL(ctx context.Context, baseURL string) context.Context {
return context.WithValue(ctx, compliancePortalBaseURLKey, &baseURL)
}