Preserve original URL
This commit is contained in:
parent
cdab12a8e5
commit
d16e89df1e
1 changed files with 8 additions and 2 deletions
|
|
@ -15,7 +15,11 @@ export type TransportOptions = {
|
|||
|
||||
function createSSETransport(options: TransportOptions): Transport {
|
||||
const baseUrl = new URL(options.url ?? "");
|
||||
// Create new URL while preserving the port from baseUrl
|
||||
const sseUrl = new URL("/sse", baseUrl);
|
||||
if (baseUrl.port) {
|
||||
sseUrl.port = baseUrl.port;
|
||||
}
|
||||
|
||||
return new SSEClientTransport(sseUrl);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue