diff --git a/domain/meta/endpoint.go b/domain/meta/endpoint.go index 5aea9328..65796a8e 100644 --- a/domain/meta/endpoint.go +++ b/domain/meta/endpoint.go @@ -310,12 +310,20 @@ func (h *Handler) Logo(w http.ResponseWriter, r *http.Request) { ctx := domain.GetRequestContext(r) d := organization.GetSubdomainFromHost(r) - // If organization has logo, send it back. + // If organization has logo, send it back by using specified subdomain. logo, err := h.Store.Organization.Logo(ctx, d) if err == nil && len(logo) > 0 { h.writeLogo(w, r, logo) return } + + // Sometimes people use subdomain like docs.example.org but backend + // does not reflect that domain, e.g. dmz_org.c_domain is empty. + logo, err = h.Store.Organization.Logo(ctx, "") + if err == nil && len(logo) > 0 { + h.writeLogo(w, r, logo) + return + } if err != nil { h.Runtime.Log.Infof("unable to fetch logo for domain %s", d) }