mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 15:03:09 -06:00
Add missing file
This commit is contained in:
parent
1a6c6ea221
commit
955f949d22
|
|
@ -17,6 +17,7 @@ package routing
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
clienthttputil "github.com/matrix-org/dendrite/clientapi/httputil"
|
clienthttputil "github.com/matrix-org/dendrite/clientapi/httputil"
|
||||||
|
|
@ -202,7 +203,13 @@ func NotaryKeys(
|
||||||
fsAPI federationAPI.FederationInternalAPI,
|
fsAPI federationAPI.FederationInternalAPI,
|
||||||
req *gomatrixserverlib.PublicKeyNotaryLookupRequest,
|
req *gomatrixserverlib.PublicKeyNotaryLookupRequest,
|
||||||
) util.JSONResponse {
|
) util.JSONResponse {
|
||||||
serverName := spec.ServerName(httpReq.Host) // TODO: this is not ideal
|
// 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)
|
||||||
if !cfg.Matrix.IsLocalServerName(serverName) {
|
if !cfg.Matrix.IsLocalServerName(serverName) {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusNotFound,
|
Code: http.StatusNotFound,
|
||||||
|
|
@ -224,6 +231,7 @@ func NotaryKeys(
|
||||||
|
|
||||||
for serverName, kidToCriteria := range req.ServerKeys {
|
for serverName, kidToCriteria := range req.ServerKeys {
|
||||||
var keyList []gomatrixserverlib.ServerKeys
|
var keyList []gomatrixserverlib.ServerKeys
|
||||||
|
// Returns _all_ of our keys, incl. old keys, no matter what was requested.
|
||||||
if serverName == cfg.Matrix.ServerName {
|
if serverName == cfg.Matrix.ServerName {
|
||||||
if k, err := localKeys(cfg, serverName); err == nil {
|
if k, err := localKeys(cfg, serverName); err == nil {
|
||||||
keyList = append(keyList, *k)
|
keyList = append(keyList, *k)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue