From 0ab7cddf2f56a1d07c2e566c5c826a77f17f740a Mon Sep 17 00:00:00 2001 From: sarah <35204912+satvu@users.noreply.github.com> Date: Tue, 2 Nov 2021 10:31:04 -0700 Subject: [PATCH] Trim whitespace when processing cookie names in HttpRequestData (#696) * trim whitespace around cookie names when processing them in HttpRequestData * bump the grpc project version Co-authored-by: Sarah Vu --- release_notes.md | 1 + src/DotNetWorker.Grpc/DotNetWorker.Grpc.csproj | 1 + src/DotNetWorker.Grpc/Http/GrpcHttpRequestData.cs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/release_notes.md b/release_notes.md index aa7bdd1e..5878a22e 100644 --- a/release_notes.md +++ b/release_notes.md @@ -4,3 +4,4 @@ --> - Fixes `null` reference exception when accessing request identities (#673) - Exposed `RetryContext` to support retry policies (#316) +- Fixes leading/trailing whitespaces in HttpRequestData cookies (#694) \ No newline at end of file diff --git a/src/DotNetWorker.Grpc/DotNetWorker.Grpc.csproj b/src/DotNetWorker.Grpc/DotNetWorker.Grpc.csproj index 5fef991e..d4fbedd1 100644 --- a/src/DotNetWorker.Grpc/DotNetWorker.Grpc.csproj +++ b/src/DotNetWorker.Grpc/DotNetWorker.Grpc.csproj @@ -9,6 +9,7 @@ Microsoft.Azure.Functions.Worker.Grpc true 3 + 1 diff --git a/src/DotNetWorker.Grpc/Http/GrpcHttpRequestData.cs b/src/DotNetWorker.Grpc/Http/GrpcHttpRequestData.cs index e70dfbfc..37d85ba5 100644 --- a/src/DotNetWorker.Grpc/Http/GrpcHttpRequestData.cs +++ b/src/DotNetWorker.Grpc/Http/GrpcHttpRequestData.cs @@ -153,7 +153,7 @@ namespace Microsoft.Azure.Functions.Worker for (int c = 0; c < separateCookies.Length; c++) { var splitArray = separateCookies[c].Split("=", StringSplitOptions.RemoveEmptyEntries); - var name = splitArray[0]; + var name = splitArray[0].Trim(); var value = splitArray[1]; httpCookiesList.Add(new HttpCookie(name, value)); }