Skip to content

Commit 0f3bcf3

Browse files
authored
Allow port differing in OIDC dynamic registration URIs (#4749)
As per discussion and amendment to matrix-org/matrix-spec-proposals#2966 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 8395919 commit 0f3bcf3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

spec/unit/oidc/register.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ describe("registerOidcClient()", () => {
3232
tosUri: "https://just.testing/tos",
3333
policyUri: "https://policy.just.testing",
3434
contacts: ["admin@example.com"],
35+
logoUri: `${baseUrl}:8443/logo.png`,
3536
};
3637
const dynamicClientId = "xyz789";
3738

@@ -69,6 +70,7 @@ describe("registerOidcClient()", () => {
6970
application_type: "web",
7071
tos_uri: "https://just.testing/tos",
7172
policy_uri: "https://policy.just.testing",
73+
logo_uri: `${baseUrl}:8443/logo.png`,
7274
}),
7375
);
7476
});

src/oidc/register.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const urlHasCommonBase = (base: URL, urlStr?: string): boolean => {
5959
if (!urlStr) return false;
6060
const url = new URL(urlStr);
6161
if (url.protocol !== base.protocol) return false;
62-
if (url.host !== base.host && !url.host.endsWith(`.${base.host}`)) return false;
62+
if (url.hostname !== base.hostname && !url.hostname.endsWith(`.${base.hostname}`)) return false;
6363
return true;
6464
};
6565

0 commit comments

Comments
 (0)