Skip to content

Commit 6d416cd

Browse files
committed
Fix browser cookie tests to only run with HTTPS (#39665)
1 parent ef499fe commit 6d416cd

File tree

4 files changed

+101
-118
lines changed

4 files changed

+101
-118
lines changed

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,11 @@
44
using System.Buffers;
55
using System.Threading.Tasks;
66
using Microsoft.AspNetCore.Connections;
7-
using Microsoft.AspNetCore.Http.Connections;
87

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

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

Lines changed: 2 additions & 0 deletions
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)