From c3f5de1399e2303d0cac6b95ac8047770b159b67 Mon Sep 17 00:00:00 2001 From: Markus Jarderot Date: Mon, 12 Oct 2020 17:29:11 +0200 Subject: [PATCH] Proper use of `QueryString`. If `QueryString` is empty, then `PathString + QueryString + "&skip=1"` becomes `"/target/path&skip=1"`. If you instead do `PathString + QueryString.Add("skip", "1")`, it becomes `"/target/path?skip=1"`. --- .../Internal/StrictSameSiteExternalAuthenticationMiddleware.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BFF/src/Host/Internal/StrictSameSiteExternalAuthenticationMiddleware.cs b/BFF/src/Host/Internal/StrictSameSiteExternalAuthenticationMiddleware.cs index 679643a..70cbf36 100644 --- a/BFF/src/Host/Internal/StrictSameSiteExternalAuthenticationMiddleware.cs +++ b/BFF/src/Host/Internal/StrictSameSiteExternalAuthenticationMiddleware.cs @@ -35,7 +35,7 @@ public async Task Invoke(HttpContext ctx) } else if (ctx.Request.Method == "GET" && !ctx.Request.Query["skip"].Any()) { - location = ctx.Request.Path + ctx.Request.QueryString + "&skip=1"; + location = ctx.Request.Path + ctx.Request.QueryString.Add("skip", "1"); } if (location != null)