Handle possibly trailing slashes for older versions of mxisd
This commit is contained in:
@@ -53,6 +53,7 @@ public class HttpMxisd {
|
||||
public void start() {
|
||||
m.start();
|
||||
|
||||
HttpHandler helloHandler = SaneHandler.around(new HelloHandler());
|
||||
HttpHandler asNotFoundHandler = SaneHandler.around(new AsNotFoundHandler(m.getAs()));
|
||||
HttpHandler asTxnHandler = SaneHandler.around(new AsTransactionHandler(m.getAs()));
|
||||
HttpHandler storeInvHandler = SaneHandler.around(new StoreInviteHandler(m.getConfig().getServer(), m.getInvitationManager(), m.getKeyManager()));
|
||||
@@ -79,7 +80,8 @@ public class HttpMxisd {
|
||||
.get(EphemeralKeyIsValidHandler.Path, SaneHandler.around(new EphemeralKeyIsValidHandler()))
|
||||
|
||||
// Identity endpoints
|
||||
.get(HelloHandler.Path, SaneHandler.around(new HelloHandler()))
|
||||
.get(HelloHandler.Path, helloHandler)
|
||||
.get(HelloHandler.Path + "/", helloHandler) // Be lax with possibly trailing slash
|
||||
.get(SingleLookupHandler.Path, SaneHandler.around(new SingleLookupHandler(m.getIdentity(), m.getSign())))
|
||||
.post(BulkLookupHandler.Path, SaneHandler.around(new BulkLookupHandler(m.getIdentity())))
|
||||
.post(StoreInviteHandler.Path, storeInvHandler)
|
||||
|
@@ -3,6 +3,7 @@ package io.kamax.mxisd.matrix;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.JsonParser;
|
||||
import io.kamax.mxisd.http.IsAPIv1;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
@@ -32,7 +33,7 @@ public class IdentityServerUtils {
|
||||
|
||||
try {
|
||||
// FIXME use Apache HTTP client
|
||||
HttpURLConnection rootSrvConn = (HttpURLConnection) new URL(remote + "/_matrix/identity/api/v1/").openConnection();
|
||||
HttpURLConnection rootSrvConn = (HttpURLConnection) new URL(remote + IsAPIv1.Base).openConnection();
|
||||
// TODO turn this into a configuration property
|
||||
rootSrvConn.setConnectTimeout(2000);
|
||||
|
||||
|
Reference in New Issue
Block a user