If the license is cloud, use the SiteURL instead of the X-Forwarded-Proto header (#19393)

This commit is contained in:
Nick Misasi
2022-01-21 11:32:03 -05:00
committed by GitHub
parent a0e870bed2
commit dcd4e50bde

View File

@@ -207,6 +207,9 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
subpath, _ := utils.GetSubpathFromConfig(c.App.Config())
siteURLHeader := app.GetProtocol(r) + "://" + r.Host + subpath
if c.App.Srv().License() != nil && *c.App.Srv().License().Features.Cloud {
siteURLHeader = *c.App.Config().ServiceSettings.SiteURL + subpath
}
c.SetSiteURLHeader(siteURLHeader)
w.Header().Set(model.HeaderRequestId, c.AppContext.RequestId())