mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-06 06:23:10 -06:00
parent
955f949d22
commit
705a5cfb74
|
|
@ -17,7 +17,6 @@ package routing
|
|||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
clienthttputil "github.com/matrix-org/dendrite/clientapi/httputil"
|
||||
|
|
@ -203,13 +202,7 @@ func NotaryKeys(
|
|||
fsAPI federationAPI.FederationInternalAPI,
|
||||
req *gomatrixserverlib.PublicKeyNotaryLookupRequest,
|
||||
) util.JSONResponse {
|
||||
// strip any additional :PORT from httpReq.Host
|
||||
s := httpReq.Host
|
||||
if i := strings.Index(s, ":"); i > 0 {
|
||||
s = httpReq.Host[:i]
|
||||
}
|
||||
|
||||
serverName := spec.ServerName(s)
|
||||
serverName := spec.ServerName(httpReq.Host) // TODO: this is not ideal
|
||||
if !cfg.Matrix.IsLocalServerName(serverName) {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusNotFound,
|
||||
|
|
@ -231,7 +224,6 @@ func NotaryKeys(
|
|||
|
||||
for serverName, kidToCriteria := range req.ServerKeys {
|
||||
var keyList []gomatrixserverlib.ServerKeys
|
||||
// Returns _all_ of our keys, incl. old keys, no matter what was requested.
|
||||
if serverName == cfg.Matrix.ServerName {
|
||||
if k, err := localKeys(cfg, serverName); err == nil {
|
||||
keyList = append(keyList, *k)
|
||||
|
|
|
|||
Loading…
Reference in a new issue