rollback path preservation fix
This commit is contained in:
parent
6be4c60c45
commit
82f5f70924
1 changed files with 0 additions and 70 deletions
|
|
@ -68,71 +68,6 @@ describe("SSEClientTransport", () => {
|
|||
});
|
||||
|
||||
describe("connection handling", () => {
|
||||
it("maintains custom path when constructing endpoint URL", async () => {
|
||||
// Create a URL with a custom path
|
||||
const customPathUrl = new URL("/custom/path/sse", baseUrl);
|
||||
transport = new SSEClientTransport(customPathUrl);
|
||||
|
||||
// Start the transport
|
||||
await transport.start();
|
||||
|
||||
// Send a test message to verify the endpoint URL
|
||||
const message: JSONRPCMessage = {
|
||||
jsonrpc: "2.0",
|
||||
id: "test-1",
|
||||
method: "test",
|
||||
params: {}
|
||||
};
|
||||
|
||||
await transport.send(message);
|
||||
|
||||
// Verify the POST request maintains the custom path
|
||||
expect(lastServerRequest.url).toBe("/custom/path/sse");
|
||||
});
|
||||
|
||||
it("handles multiple levels of custom paths", async () => {
|
||||
// Test with a deeper nested path
|
||||
const nestedPathUrl = new URL("/api/v1/custom/deep/path/sse", baseUrl);
|
||||
transport = new SSEClientTransport(nestedPathUrl);
|
||||
|
||||
await transport.start();
|
||||
|
||||
const message: JSONRPCMessage = {
|
||||
jsonrpc: "2.0",
|
||||
id: "test-1",
|
||||
method: "test",
|
||||
params: {}
|
||||
};
|
||||
|
||||
await transport.send(message);
|
||||
|
||||
// Verify the POST request maintains the full custom path
|
||||
expect(lastServerRequest.url).toBe("/api/v1/custom/deep/path/sse");
|
||||
});
|
||||
|
||||
it("maintains custom path for SSE connection", async () => {
|
||||
const customPathUrl = new URL("/custom/path/sse", baseUrl);
|
||||
transport = new SSEClientTransport(customPathUrl);
|
||||
await transport.start();
|
||||
expect(lastServerRequest.url).toBe("/custom/path/sse");
|
||||
});
|
||||
|
||||
it("handles URLs with query parameters", async () => {
|
||||
const urlWithQuery = new URL("/custom/path/sse?param=value", baseUrl);
|
||||
transport = new SSEClientTransport(urlWithQuery);
|
||||
await transport.start();
|
||||
|
||||
const message: JSONRPCMessage = {
|
||||
jsonrpc: "2.0",
|
||||
id: "test-1",
|
||||
method: "test",
|
||||
params: {}
|
||||
};
|
||||
|
||||
await transport.send(message);
|
||||
expect(lastServerRequest.url).toBe("/custom/path/sse");
|
||||
});
|
||||
|
||||
it("establishes SSE connection and receives endpoint", async () => {
|
||||
transport = new SSEClientTransport(baseUrl);
|
||||
await transport.start();
|
||||
|
|
|
|||
Loading…
Reference in a new issue