switch to optional Transport.setProtocolVersion
This commit is contained in:
parent
4aaa26d900
commit
33257f14d4
1 changed files with 22 additions and 17 deletions
|
|
@ -62,7 +62,7 @@ export class SSEClientTransport implements Transport {
|
|||
private _eventSourceInit?: EventSourceInit;
|
||||
private _requestInit?: RequestInit;
|
||||
private _authProvider?: OAuthClientProvider;
|
||||
protocolVersion?: string;
|
||||
private _protocolVersion?: string;
|
||||
|
||||
onclose?: () => void;
|
||||
onerror?: (error: Error) => void;
|
||||
|
|
@ -109,8 +109,8 @@ export class SSEClientTransport implements Transport {
|
|||
headers["Authorization"] = `Bearer ${tokens.access_token}`;
|
||||
}
|
||||
}
|
||||
if (this.protocolVersion) {
|
||||
headers["mcp-protocol-version"] = this.protocolVersion;
|
||||
if (this._protocolVersion) {
|
||||
headers["mcp-protocol-version"] = this._protocolVersion;
|
||||
}
|
||||
|
||||
return headers;
|
||||
|
|
@ -255,4 +255,8 @@ export class SSEClientTransport implements Transport {
|
|||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
setProtocolVersion(version: string): void {
|
||||
this._protocolVersion = version;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue