mirror of
https://github.com/matrix-org/dendrite
synced 2024-11-18 07:40:53 +01:00
Virtual host server name workaround
This commit is contained in:
parent
deddf686b9
commit
d558da1c87
1 changed files with 11 additions and 1 deletions
|
@ -16,6 +16,7 @@ package routing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -190,7 +191,16 @@ func localKeys(cfg *config.FederationAPI, serverName gomatrixserverlib.ServerNam
|
||||||
|
|
||||||
identity, err := cfg.Matrix.SigningIdentityFor(serverName)
|
identity, err := cfg.Matrix.SigningIdentityFor(serverName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
// TODO: This is a bit of a hack because the Host header can contain a port
|
||||||
|
// number if it's specified in the well-known file. Try getting a signing
|
||||||
|
// identity without it to see if that helps.
|
||||||
|
var h string
|
||||||
|
if h, _, err = net.SplitHostPort(string(serverName)); err == nil {
|
||||||
|
identity, err = cfg.Matrix.SigningIdentityFor(gomatrixserverlib.ServerName(h))
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
keys.Raw, err = gomatrixserverlib.SignJSON(
|
keys.Raw, err = gomatrixserverlib.SignJSON(
|
||||||
|
|
Loading…
Reference in a new issue