Skip to content

Commit ed64dd1

Browse files
committed
revert saving protocol
1 parent 24d0034 commit ed64dd1

File tree

3 files changed

+1
-30
lines changed

3 files changed

+1
-30
lines changed

src/server/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,12 +442,6 @@ export class Server<
442442

443443
const protocolVersion = SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) ? requestedVersion : LATEST_PROTOCOL_VERSION;
444444

445-
// Inform the transport of the negotiated protocol version.
446-
// This allows the transport to validate subsequent request headers.
447-
if (this.transport?.setProtocolVersion) {
448-
this.transport.setProtocolVersion(protocolVersion);
449-
}
450-
451445
return {
452446
protocolVersion,
453447
capabilities: this.getCapabilities(),

src/server/streamableHttp.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ export class StreamableHTTPServerTransport implements Transport {
184184
private _allowedOrigins?: string[];
185185
private _enableDnsRebindingProtection: boolean;
186186
private _retryInterval?: number;
187-
private _protocolVersion?: string;
188187

189188
sessionId?: string;
190189
onclose?: () => void;
@@ -214,21 +213,6 @@ export class StreamableHTTPServerTransport implements Transport {
214213
this._started = true;
215214
}
216215

217-
/**
218-
* Sets the protocol version after negotiation during initialization.
219-
* This is called by the Server class after the initialize handshake completes.
220-
*/
221-
setProtocolVersion(version: string): void {
222-
this._protocolVersion = version;
223-
}
224-
225-
/**
226-
* Gets the negotiated protocol version, if set.
227-
*/
228-
get protocolVersion(): string | undefined {
229-
return this._protocolVersion;
230-
}
231-
232216
/**
233217
* Validates request headers for DNS rebinding protection.
234218
* @returns Error message if validation fails, undefined if validation passes.

src/shared/transport.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,7 @@ export interface Transport {
122122
sessionId?: string;
123123

124124
/**
125-
* Sets the protocol version after negotiation during initialization.
126-
* This is called by the Server/Client class after the initialize handshake completes.
125+
* Sets the protocol version used for the connection (called when the initialize response is received).
127126
*/
128127
setProtocolVersion?: (version: string) => void;
129-
130-
/**
131-
* Gets the negotiated protocol version, if set.
132-
* Available after initialization completes.
133-
*/
134-
protocolVersion?: string;
135128
}

0 commit comments

Comments
 (0)