Host header, not Host field

This commit is contained in:
Neil Alexander 2022-11-18 12:32:13 +00:00
parent 0227613214
commit 48ea920541
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -551,9 +551,10 @@ func Register(
} }
var r registerRequest var r registerRequest
r.ServerName = cfg.Matrix.ServerName if v := cfg.Matrix.VirtualHostForHTTPHost(gomatrixserverlib.ServerName(req.Header.Get("Host"))); v != nil {
if v := cfg.Matrix.VirtualHostForHTTPHost(gomatrixserverlib.ServerName(req.Host)); v != nil {
r.ServerName = v.ServerName r.ServerName = v.ServerName
} else {
r.ServerName = cfg.Matrix.ServerName
} }
sessionID := gjson.GetBytes(reqBody, "auth.session").String() sessionID := gjson.GetBytes(reqBody, "auth.session").String()
if sessionID == "" { if sessionID == "" {