1 parent d8a3dc5 commit 752d83aCopy full SHA for 752d83a
1 file changed
tests/CHttpServer.Tests/TestServer.cs
@@ -83,6 +83,18 @@ async IAsyncEnumerable<string> GetStream()
83
}
84
return GetStream();
85
});
86
+ _app.MapGet("/sse", (HttpContext ctx) =>
87
+ {
88
+ async IAsyncEnumerable<string> GetStream()
89
90
+ foreach (var i in Enumerable.Range(0, 2))
91
92
+ await Task.Delay(1000);
93
+ yield return "some content";
94
+ }
95
96
+ return Results.ServerSentEvents(GetStream());
97
+ });
98
_app.MapGet("/headerstrailers", async (HttpContext ctx) =>
99
{
100
if (!ctx.Request.Headers.Accept.Contains("application/json") || ctx.Request.Headers["x-custom"] != "custom-header-value")
0 commit comments