changed Matrix homeserver URL in request to App Service URL

This commit is contained in:
Derek Meer 2018-08-03 13:04:49 -07:00
parent 5b5ec0cd67
commit 4b3bd45092

View file

@ -27,14 +27,14 @@ func URIToUID(req *http.Request, cfg config.Dendrite) util.JSONResponse {
JSON: nil, JSON: nil,
} }
} }
baseReqURL := "http://" + string(cfg.Matrix.ServerName) + "/_matrix/app/unstable/thirdparty/user/"
for _, appservice := range cfg.Derived.ApplicationServices { for _, appservice := range cfg.Derived.ApplicationServices {
// Check all the fields associated with each application service // Check all the fields associated with each application service
if !appservice.IsInterestedInUserID(uri) { if !appservice.IsInterestedInUserID(uri) {
continue continue
} }
// call the application service // call the application service
reqURL := baseReqURL + appservice.ID + "?access_token=" + appservice.HSToken + reqURL := "http://" + appservice.URL + "/_matrix/app/unstable/thirdparty/user/" +
appservice.ID + "?access_token=" + appservice.HSToken +
"&fields=" + uri "&fields=" + uri
resp, err := http.Get(reqURL) resp, err := http.Get(reqURL)
// take the first successful match and send that back to the user // take the first successful match and send that back to the user