Skip to content

Commit 92b167a

Browse files
committed
fix samesite bug from aspnet code to check for null userAgent
1 parent 0ab28e7 commit 92b167a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Microsoft.Identity.Web/WebAppServiceCollectionExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ private static void CheckSameSite(HttpContext httpContext, CookieOptions options
206206
// Method taken from https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/
207207
public static bool DisallowsSameSiteNone(string userAgent)
208208
{
209+
if (string.IsNullOrEmpty(userAgent))
210+
{
211+
return false;
212+
}
213+
209214
// Cover all iOS based browsers here. This includes:
210215
// - Safari on iOS 12 for iPhone, iPod Touch, iPad
211216
// - WkWebview on iOS 12 for iPhone, iPod Touch, iPad

0 commit comments

Comments
 (0)