| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fd19c7d commit f3f6843
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -122,7 +122,7 @@ public async Task Server_AcceptsUnionIntegerCanonicalForm() | |||
| 122 | 122 | ||
| 123 | 123 | using var request = new HttpRequestMessage(HttpMethod.Post, ""); | |
| 124 | 124 | request.Content = new StringContent(callJson, Encoding.UTF8, "application/json"); | |
| 125 | - request.Headers.Add("MCP-Protocol-Version", "DRAFT-2026-v1"); | ||
| 125 | + request.Headers.Add("MCP-Protocol-Version", "2026-07-28"); | ||
| 126 | 126 | request.Headers.Add("Mcp-Method", "tools/call"); | |
| 127 | 127 | request.Headers.Add("Mcp-Name", "union_test"); | |
| 128 | 128 | request.Headers.Add("Mcp-Param-Priority", "42"); | |
@@ -141,7 +141,7 @@ public async Task Server_RejectsUnionIntegerOutsideSafeRange() | |||
| 141 | 141 | ||
| 142 | 142 | using var request = new HttpRequestMessage(HttpMethod.Post, ""); | |
| 143 | 143 | request.Content = new StringContent(callJson, Encoding.UTF8, "application/json"); | |
| 144 | - request.Headers.Add("MCP-Protocol-Version", "DRAFT-2026-v1"); | ||
| 144 | + request.Headers.Add("MCP-Protocol-Version", "2026-07-28"); | ||
| 145 | 145 | request.Headers.Add("Mcp-Method", "tools/call"); | |
| 146 | 146 | request.Headers.Add("Mcp-Name", "union_test"); | |
| 147 | 147 | request.Headers.Add("Mcp-Param-Priority", "9007199254740993"); | |
@@ -161,7 +161,7 @@ public async Task Server_AcceptsExponentBodyMatchingDecimalHeader() | |||
| 161 | 161 | ||
| 162 | 162 | using var request = new HttpRequestMessage(HttpMethod.Post, ""); | |
| 163 | 163 | request.Content = new StringContent(callJson, Encoding.UTF8, "application/json"); | |
| 164 | - request.Headers.Add("MCP-Protocol-Version", "DRAFT-2026-v1"); | ||
| 164 | + request.Headers.Add("MCP-Protocol-Version", "2026-07-28"); | ||
| 165 | 165 | request.Headers.Add("Mcp-Method", "tools/call"); | |
| 166 | 166 | request.Headers.Add("Mcp-Name", "header_test"); | |
| 167 | 167 | request.Headers.Add("Mcp-Param-Region", "test"); | |
@@ -334,7 +334,7 @@ public async Task Server_RejectsIntegerOutsideSafeRange(string outOfRangeValue) | |||
| 334 | 334 | ||
| 335 | 335 | using var request = new HttpRequestMessage(HttpMethod.Post, ""); | |
| 336 | 336 | request.Content = new StringContent(callJson, Encoding.UTF8, "application/json"); | |
| 337 | - request.Headers.Add("MCP-Protocol-Version", "DRAFT-2026-v1"); | ||
| 337 | + request.Headers.Add("MCP-Protocol-Version", "2026-07-28"); | ||
| 338 | 338 | request.Headers.Add("Mcp-Method", "tools/call"); | |
| 339 | 339 | request.Headers.Add("Mcp-Name", "header_test"); | |
| 340 | 340 | request.Headers.Add("Mcp-Param-Region", "test"); | |
@@ -391,7 +391,7 @@ public async Task Server_RejectsNonIntegerValue_EvenWhenHeaderAndBodyMatch(strin | |||
| 391 | 391 | ||
| 392 | 392 | using var request = new HttpRequestMessage(HttpMethod.Post, ""); | |
| 393 | 393 | request.Content = new StringContent(callJson, Encoding.UTF8, "application/json"); | |
| 394 | - request.Headers.Add("MCP-Protocol-Version", "DRAFT-2026-v1"); | ||
| 394 | + request.Headers.Add("MCP-Protocol-Version", "2026-07-28"); | ||
| 395 | 395 | request.Headers.Add("Mcp-Method", "tools/call"); | |
| 396 | 396 | request.Headers.Add("Mcp-Name", "header_test"); | |
| 397 | 397 | request.Headers.Add("Mcp-Param-Region", "test"); | |
@@ -620,3 +620,4 @@ private string CallTool(string toolName, string arguments = "{}") | |||
| 620 | 620 | ||
| 621 | 621 | #endregion | |
| 622 | 622 | } | |
| 623 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -211,7 +211,7 @@ public async Task IdleTrackingBackgroundService_StartsTimer_WhenStateful() | |||
| 211 | 211 | { | |
| 212 | 212 | Builder.Services | |
| 213 | 213 | .AddMcpServer() | |
| 214 | - .WithHttpTransport(); | ||
| 214 | + .WithHttpTransport(options => options.Stateless = false); | ||
| 215 | 215 | ||
| 216 | 216 | using var app = Builder.Build(); | |
| 217 | 217 | ||
@@ -220,7 +220,7 @@ public async Task IdleTrackingBackgroundService_StartsTimer_WhenStateful() | |||
| 220 | 220 | ||
| 221 | 221 | await idleTrackingService.StartAsync(TestContext.Current.CancellationToken); | |
| 222 | 222 | ||
| 223 | - // In the default (stateful) mode the timer loop must start, so ExecuteTask should be set. | ||
| 223 | + // In stateful mode the timer loop must start, so ExecuteTask should be set. | ||
| 224 | 224 | Assert.NotNull(idleTrackingService.ExecuteTask); | |
| 225 | 225 | ||
| 226 | 226 | await idleTrackingService.StopAsync(TestContext.Current.CancellationToken); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | - using Microsoft.Extensions.DependencyInjection; | ||
| 1 | + #if !NET472 | ||
| 2 | + using Microsoft.Extensions.DependencyInjection; | ||
| 2 | 3 | using Microsoft.Extensions.Logging; | |
| 3 | 4 | using ModelContextProtocol.Protocol; | |
| 4 | 5 | using ModelContextProtocol.Server; | |
@@ -71,7 +72,7 @@ public async ValueTask DisposeAsync() | |||
| 71 | 72 | ||
| 72 | 73 | private async Task<JsonNode> ReadAsync() | |
| 73 | 74 | { | |
| 74 | - var line = await _reader.ReadLineAsync(_cts.Token); | ||
| 75 | + var line = await _reader.ReadLineAsync(_cts.Token).ConfigureAwait(false); | ||
| 75 | 76 | Assert.NotNull(line); | |
| 76 | 77 | return JsonNode.Parse(line!)!; | |
| 77 | 78 | } | |
@@ -184,3 +185,4 @@ public async Task MixedSequence_Discover_Then_Initialize_Then_ToolsCall_AllSucce | |||
| 184 | 185 | Assert.Equal("echo:after-init", call["result"]!["content"]![0]!["text"]!.GetValue<string>()); | |
| 185 | 186 | } | |
| 186 | 187 | } | |
| 188 | + #endif | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments