From ade803fc366b35be6df53f61dac16f47460f57c3 Mon Sep 17 00:00:00 2001 From: Brennan Date: Fri, 20 Sep 2024 14:01:16 -0700 Subject: [PATCH 1/2] Add partitioned to cookie for SignalR browser testing Looks like Chromium (not chrome) headless now requires 'partitioned' on the cookie when using `Secure` and `Same-Site=None` --- src/SignalR/clients/ts/FunctionalTests/Startup.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SignalR/clients/ts/FunctionalTests/Startup.cs b/src/SignalR/clients/ts/FunctionalTests/Startup.cs index 45d3f8546a71..ee143fee26c6 100644 --- a/src/SignalR/clients/ts/FunctionalTests/Startup.cs +++ b/src/SignalR/clients/ts/FunctionalTests/Startup.cs @@ -184,9 +184,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger< { cookieOptions.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None; cookieOptions.Secure = true; + cookieOptions.Extensions.Add("partitioned"); expiredCookieOptions.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None; expiredCookieOptions.Secure = true; + expiredCookieOptions.Extensions.Add("partitioned"); } context.Response.Cookies.Append("testCookie", "testValue", cookieOptions); context.Response.Cookies.Append("testCookie2", "testValue2", cookieOptions); From 3b35813c42f5cf2a223c3b5a63774b761aeb35a9 Mon Sep 17 00:00:00 2001 From: Brennan Date: Fri, 20 Sep 2024 14:51:31 -0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Andrew Casey --- src/SignalR/clients/ts/FunctionalTests/Startup.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SignalR/clients/ts/FunctionalTests/Startup.cs b/src/SignalR/clients/ts/FunctionalTests/Startup.cs index ee143fee26c6..dd3ee9378458 100644 --- a/src/SignalR/clients/ts/FunctionalTests/Startup.cs +++ b/src/SignalR/clients/ts/FunctionalTests/Startup.cs @@ -184,11 +184,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger< { cookieOptions.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None; cookieOptions.Secure = true; - cookieOptions.Extensions.Add("partitioned"); + cookieOptions.Extensions.Add("partitioned"); // Required by Chromium expiredCookieOptions.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None; expiredCookieOptions.Secure = true; - expiredCookieOptions.Extensions.Add("partitioned"); + expiredCookieOptions.Extensions.Add("partitioned"); // Required by Chromium } context.Response.Cookies.Append("testCookie", "testValue", cookieOptions); context.Response.Cookies.Append("testCookie2", "testValue2", cookieOptions);