From 88a0c0cddf94204e400ad0b2164a429f792d605a Mon Sep 17 00:00:00 2001 From: Brian Feister Date: Wed, 8 Jan 2025 20:20:00 -0700 Subject: [PATCH] initial attempt at enabling subdomain community / profile pages --- functions/gateway/handlers/page_handlers.go | 6 ++++-- functions/gateway/templates/pages/layout.templ | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/functions/gateway/handlers/page_handlers.go b/functions/gateway/handlers/page_handlers.go index 3520af37..da8c4770 100644 --- a/functions/gateway/handlers/page_handlers.go +++ b/functions/gateway/handlers/page_handlers.go @@ -207,7 +207,10 @@ func DeriveEventsFromRequest(r *http.Request) ([]types.Event, helpers.CdnLocatio aboutChan := make(chan aboutResult, 1) var pageUser *helpers.UserSearchResult - + subdomainValue := r.Header.Get("X-Mnm-Subdomain-Value") + if subdomainValue != "" { + userId = subdomainValue + } // Start concurrent operations if userId exists if userId != "" { // Single goroutine for all three requests when userId exists @@ -227,7 +230,6 @@ func DeriveEventsFromRequest(r *http.Request) ([]types.Event, helpers.CdnLocatio return } - subdomainValue := r.Header.Get("X-Mnm-Subdomain-Value") if subdomainValue != "" { ownerIds = []string{subdomainValue} } else { diff --git a/functions/gateway/templates/pages/layout.templ b/functions/gateway/templates/pages/layout.templ index a6da42f4..4a7301f8 100644 --- a/functions/gateway/templates/pages/layout.templ +++ b/functions/gateway/templates/pages/layout.templ @@ -23,7 +23,7 @@ templ Layout(sitePage helpers.SitePage, userInfo helpers.UserInfo, pageContent t // 🚨 WARNING 🚨 This filename is automatically updated by PostCSS // ✅ DO commit it to version control whenever you see it change - +