Skip to content

Commit a7f9c59

Browse files
ochafikclaude
andcommitted
Fix SSE test resource URL validation errors
Fixed 5 instances of hardcoded "https://resource.example.com" in OAuth protected resource metadata mocks to use the actual resourceBaseUrl.href. This resolves test failures where the auth validation was rejecting requests because the resource URL in the metadata didn't match the actual test server URL. The failing tests were: - attempts auth flow on 401 during SSE connection - attempts auth flow on 401 during POST request - refreshes expired token during SSE connection - refreshes expired token during POST request - redirects to authorization if refresh token flow fails All SSE tests now pass (17/17). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent bac384f commit a7f9c59

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/client/sse.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ describe("SSEClientTransport", () => {
398398
'Content-Type': 'application/json',
399399
})
400400
.end(JSON.stringify({
401-
resource: "https://resource.example.com",
401+
resource: resourceBaseUrl.href,
402402
authorization_servers: [`${authBaseUrl}`],
403403
}));
404404
return;
@@ -450,7 +450,7 @@ describe("SSEClientTransport", () => {
450450
'Content-Type': 'application/json',
451451
})
452452
.end(JSON.stringify({
453-
resource: "https://resource.example.com",
453+
resource: resourceBaseUrl.href,
454454
authorization_servers: [`${authBaseUrl}`],
455455
}));
456456
return;
@@ -601,7 +601,7 @@ describe("SSEClientTransport", () => {
601601
'Content-Type': 'application/json',
602602
})
603603
.end(JSON.stringify({
604-
resource: "https://resource.example.com",
604+
resource: resourceBaseUrl.href,
605605
authorization_servers: [`${authBaseUrl}`],
606606
}));
607607
return;
@@ -723,7 +723,7 @@ describe("SSEClientTransport", () => {
723723
'Content-Type': 'application/json',
724724
})
725725
.end(JSON.stringify({
726-
resource: "https://resource.example.com",
726+
resource: resourceBaseUrl.href,
727727
authorization_servers: [`${authBaseUrl}`],
728728
}));
729729
return;
@@ -851,7 +851,7 @@ describe("SSEClientTransport", () => {
851851
'Content-Type': 'application/json',
852852
})
853853
.end(JSON.stringify({
854-
resource: "https://resource.example.com",
854+
resource: resourceBaseUrl.href,
855855
authorization_servers: [`${authBaseUrl}`],
856856
}));
857857
return;

0 commit comments

Comments
 (0)