Skip to content

Commit 4893e3f

Browse files
Fix browser cookie tests to only run with HTTPS (#39665)
1 parent 7b7436f commit 4893e3f

File tree

4 files changed

+101
-116
lines changed

4 files changed

+101
-116
lines changed

src/SignalR/clients/ts/FunctionalTests/EchoConnectionHandler.cs

-8
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,13 @@
33

44
using System.Buffers;
55
using Microsoft.AspNetCore.Connections;
6-
using Microsoft.AspNetCore.Http.Connections;
76

87
namespace FunctionalTests;
98

109
public class EchoConnectionHandler : ConnectionHandler
1110
{
1211
public override async Task OnConnectedAsync(ConnectionContext connection)
1312
{
14-
var context = connection.GetHttpContext();
15-
// The 'withCredentials' tests wont send a cookie for cross-site requests
16-
if (!context.WebSockets.IsWebSocketRequest && !context.Request.Cookies.ContainsKey("testCookie"))
17-
{
18-
return;
19-
}
20-
2113
while (true)
2214
{
2315
var result = await connection.Transport.Input.ReadAsync();

src/SignalR/clients/ts/FunctionalTests/ts/ConnectionTests.ts

+2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ describe("connection", () => {
185185

186186
await connection.start(TransferFormat.Text);
187187

188+
await connection.stop();
189+
188190
await closePromise;
189191
});
190192
}

0 commit comments

Comments
 (0)