From 5ca666981a7a6f847d7474d1db3668a34afec58d Mon Sep 17 00:00:00 2001 From: eyecreate Date: Mon, 21 Oct 2019 14:31:40 -0400 Subject: [PATCH] make sure destination only contains the hostname value and not whole URL When testing this, the public URL is containing the protocol "https://" which differs from synapse's values. This code makes sure to remove that extra data to signatures match. Is there ever a situation in which the public url is any different? --- src/main/java/io/kamax/mxisd/session/SessionManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/kamax/mxisd/session/SessionManager.java b/src/main/java/io/kamax/mxisd/session/SessionManager.java index 004cb58..bd9f517 100644 --- a/src/main/java/io/kamax/mxisd/session/SessionManager.java +++ b/src/main/java/io/kamax/mxisd/session/SessionManager.java @@ -284,7 +284,7 @@ public class SessionManager { jsonObject.addProperty("method", "POST"); jsonObject.addProperty("uri", "/_matrix/identity/api/v1/3pid/unbind"); jsonObject.addProperty("origin", origin); - jsonObject.addProperty("destination_is", cfg.getServer().getPublicUrl()); + jsonObject.addProperty("destination_is", URI.create(cfg.getServer().getPublicUrl()).getHost()); jsonObject.add("content", reqData); String canonical = MatrixJson.encodeCanonical(jsonObject);