diff --git a/NuGet.config b/NuGet.config
index 1c2f27eb90ce..7c9e9e42b9b4 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -6,8 +6,10 @@
+
+
@@ -28,8 +30,10 @@
+
+
diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props
index 43668cf078ae..5095e569515d 100644
--- a/eng/Baseline.Designer.props
+++ b/eng/Baseline.Designer.props
@@ -2,117 +2,117 @@
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
@@ -120,138 +120,138 @@
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
+
-
+
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
-
-
+
+
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
-
+
+
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
-
-
+
+
- 8.0.17
+ 8.0.18
-
-
-
+
+
+
- 8.0.17
+ 8.0.18
-
-
+
+
- 8.0.17
+ 8.0.18
-
-
+
+
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
-
+
+
@@ -259,7 +259,7 @@
- 8.0.17
+ 8.0.18
@@ -268,51 +268,51 @@
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
-
+
+
@@ -322,8 +322,8 @@
-
-
+
+
@@ -331,8 +331,8 @@
-
-
+
+
@@ -343,58 +343,58 @@
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
-
+
+
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
@@ -403,7 +403,7 @@
- 8.0.17
+ 8.0.18
@@ -411,71 +411,71 @@
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
-
+
+
-
+
-
-
+
+
- 8.0.17
+ 8.0.18
-
-
+
+
- 8.0.17
+ 8.0.18
-
-
+
+
- 8.0.17
+ 8.0.18
@@ -491,27 +491,27 @@
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
@@ -520,23 +520,23 @@
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
@@ -545,54 +545,54 @@
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
-
+
+
-
-
+
+
-
-
+
+
- 8.0.17
+ 8.0.18
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -600,83 +600,83 @@
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
-
-
-
+
+
+
+
- 8.0.17
+ 8.0.18
@@ -685,64 +685,64 @@
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
@@ -764,7 +764,7 @@
- 8.0.17
+ 8.0.18
@@ -786,7 +786,7 @@
- 8.0.17
+ 8.0.18
@@ -802,23 +802,23 @@
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
@@ -826,24 +826,24 @@
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
-
-
+
+
+
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
@@ -853,7 +853,7 @@
- 8.0.17
+ 8.0.18
@@ -862,73 +862,73 @@
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
-
+
-
+
-
+
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
@@ -957,11 +957,11 @@
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
@@ -979,18 +979,18 @@
- 8.0.17
+ 8.0.18
- 8.0.17
+ 8.0.18
-
+
- 8.0.17
+ 8.0.18
diff --git a/eng/Baseline.xml b/eng/Baseline.xml
index 250913c6d7b5..779ed1f014e8 100644
--- a/eng/Baseline.xml
+++ b/eng/Baseline.xml
@@ -4,110 +4,110 @@ This file contains a list of all the packages and their versions which were rele
Update this list when preparing for a new patch.
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 04a4ca8534d5..e8c60c4edd2f 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -9,37 +9,37 @@
-->
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-efcore
- f7b16ef09831139dd1b087f281910e2446129bef
+ 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-efcore
- f7b16ef09831139dd1b087f281910e2446129bef
+ 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-efcore
- f7b16ef09831139dd1b087f281910e2446129bef
+ 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-efcore
- f7b16ef09831139dd1b087f281910e2446129bef
+ 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-efcore
- f7b16ef09831139dd1b087f281910e2446129bef
+ 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-efcore
- f7b16ef09831139dd1b087f281910e2446129bef
+ 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-efcore
- f7b16ef09831139dd1b087f281910e2446129bef
+ 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-efcore
- f7b16ef09831139dd1b087f281910e2446129bef
+ 271c94d1d96b2bc0b22f9f60d07f1d93abd0894f
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
@@ -121,9 +121,9 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
5535e31a712343a63f5d7d796cd874e563e5ac14
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
@@ -185,9 +185,9 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
5535e31a712343a63f5d7d796cd874e563e5ac14
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
https://github.com/dotnet/source-build-externals
@@ -255,9 +255,9 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
5535e31a712343a63f5d7d796cd874e563e5ac14
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 81cabf2857a01351e5ab578947c7403a5b128ad1
+ ef853a71052646a42abf17e888ec6d9a69614ad9
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
@@ -275,17 +275,17 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
81cabf2857a01351e5ab578947c7403a5b128ad1
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
@@ -316,22 +316,22 @@
Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
All Runtime.$rid packages should have the same version.
-->
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
https://github.com/dotnet/xdt
@@ -368,9 +368,9 @@
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
- 77545d6fd5ca79bc08198fd6d8037c14843f14ad
+ ef853a71052646a42abf17e888ec6d9a69614ad9
https://github.com/dotnet/winforms
diff --git a/eng/Versions.props b/eng/Versions.props
index 96fe6bb48d8f..692e6f2c4712 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -11,7 +11,7 @@
19
- false
+ true
7.1.2
7.*
8.0.2
- 8.0.17
- 8.0.17
- 8.0.17
- 8.0.17
- 8.0.17
- 8.0.17-servicing.25266.2
+ 8.0.18
+ 8.0.18
+ 8.0.18
+ 8.0.18
+ 8.0.18
+ 8.0.18-servicing.25311.17
8.0.0
8.0.1
8.0.0
@@ -93,7 +93,7 @@
8.0.0
8.0.0
8.0.0
- 8.0.17-servicing.25266.2
+ 8.0.18-servicing.25311.17
8.0.1
8.0.1
8.0.1
@@ -109,7 +109,7 @@
8.0.0
8.0.2
8.0.0
- 8.0.17-servicing.25266.2
+ 8.0.18-servicing.25311.17
8.0.1
8.0.1
8.0.2
@@ -125,13 +125,13 @@
8.0.0
8.0.1
8.0.0
- 8.0.5
+ 8.0.6
8.0.0
8.0.0
8.0.0
- 8.0.17-servicing.25266.2
+ 8.0.18-servicing.25311.17
- 8.0.17-servicing.25266.2
+ 8.0.18-servicing.25311.17
8.0.0
8.0.1
@@ -143,14 +143,14 @@
8.1.0-preview.23604.1
8.1.0-preview.23604.1
- 8.0.17
- 8.0.17
- 8.0.17
- 8.0.17
- 8.0.17
- 8.0.17
- 8.0.17
- 8.0.17
+ 8.0.18
+ 8.0.18
+ 8.0.18
+ 8.0.18
+ 8.0.18
+ 8.0.18
+ 8.0.18
+ 8.0.18
4.8.0-7.24574.2
4.8.0-7.24574.2
@@ -200,7 +200,7 @@
15.9.3032
6.0.1
- 8.0.5
+ $(SystemTextJsonVersion)
4.7.0
5.0.0
diff --git a/global.json b/global.json
index d06b451abcc6..33fc1c7a343c 100644
--- a/global.json
+++ b/global.json
@@ -1,9 +1,9 @@
{
"sdk": {
- "version": "8.0.117"
+ "version": "8.0.118"
},
"tools": {
- "dotnet": "8.0.117",
+ "dotnet": "8.0.118",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
diff --git a/src/Http/Headers/test/CookieHeaderValueTest.cs b/src/Http/Headers/test/CookieHeaderValueTest.cs
index 6623a8ed13dd..6ad2e962d005 100644
--- a/src/Http/Headers/test/CookieHeaderValueTest.cs
+++ b/src/Http/Headers/test/CookieHeaderValueTest.cs
@@ -75,7 +75,7 @@ public static TheoryData InvalidCookieValues
}
}
- public static TheoryData, string?[]> ListOfCookieHeaderDataSet
+ public static TheoryData, string?[]> ListOfStrictCookieHeaderDataSet
{
get
{
@@ -94,19 +94,30 @@ public static TheoryData InvalidCookieValues
dataset.Add(new[] { header1 }.ToList(), new[] { string1 });
dataset.Add(new[] { header1, header1 }.ToList(), new[] { string1, string1 });
- dataset.Add(new[] { header1, header1 }.ToList(), new[] { string1, null, "", " ", ";", " , ", string1 });
dataset.Add(new[] { header2 }.ToList(), new[] { string2 });
dataset.Add(new[] { header1, header2 }.ToList(), new[] { string1, string2 });
- dataset.Add(new[] { header1, header2 }.ToList(), new[] { string1 + ", " + string2 });
dataset.Add(new[] { header2, header1 }.ToList(), new[] { string2 + "; " + string1 });
dataset.Add(new[] { header1, header2, header3, header4 }.ToList(), new[] { string1, string2, string3, string4 });
- dataset.Add(new[] { header1, header2, header3, header4 }.ToList(), new[] { string.Join(",", string1, string2, string3, string4) });
dataset.Add(new[] { header1, header2, header3, header4 }.ToList(), new[] { string.Join(";", string1, string2, string3, string4) });
return dataset;
}
}
+ public static TheoryData, string?[]> ListOfCookieHeaderDataSet
+ {
+ get
+ {
+ var header1 = new CookieHeaderValue("name1", "n1=v1&n2=v2&n3=v3");
+ var string1 = "name1=n1=v1&n2=v2&n3=v3";
+
+ var dataset = new TheoryData, string?[]>();
+ dataset.Concat(ListOfStrictCookieHeaderDataSet);
+ dataset.Add(new[] { header1, header1 }.ToList(), new[] { string1, null, "", " ", ";", " , ", string1 });
+ return dataset;
+ }
+ }
+
public static TheoryData?, string?[]> ListWithInvalidCookieHeaderDataSet
{
get
@@ -127,18 +138,19 @@ public static TheoryData InvalidCookieValues
dataset.Add(new[] { header1 }.ToList(), new[] { validString1, invalidString1 });
dataset.Add(new[] { header1 }.ToList(), new[] { validString1, null, "", " ", ";", " , ", invalidString1 });
dataset.Add(new[] { header1 }.ToList(), new[] { invalidString1, null, "", " ", ";", " , ", validString1 });
- dataset.Add(new[] { header1 }.ToList(), new[] { validString1 + ", " + invalidString1 });
- dataset.Add(new[] { header2 }.ToList(), new[] { invalidString1 + ", " + validString2 });
+ dataset.Add(null, new[] { validString1 + ", " });
+ dataset.Add(null, new[] { invalidString1 + ", " + validString2 });
dataset.Add(new[] { header1 }.ToList(), new[] { invalidString1 + "; " + validString1 });
dataset.Add(new[] { header2 }.ToList(), new[] { validString2 + "; " + invalidString1 });
dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { invalidString1, validString1, validString2, validString3 });
dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { validString1, invalidString1, validString2, validString3 });
dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { validString1, validString2, invalidString1, validString3 });
dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { validString1, validString2, validString3, invalidString1 });
- dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(",", invalidString1, validString1, validString2, validString3) });
- dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(",", validString1, invalidString1, validString2, validString3) });
- dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(",", validString1, validString2, invalidString1, validString3) });
- dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(",", validString1, validString2, validString3, invalidString1) });
+ dataset.Add(null, new[] { string.Join(",", invalidString1, validString1, validString2, validString3) });
+ dataset.Add(null, new[] { string.Join(",", validString1, invalidString1, validString2, validString3) });
+ dataset.Add(null, new[] { string.Join(",", validString1, validString2, invalidString1, validString3) });
+ dataset.Add(null, new[] { string.Join(",", validString1, validString2, validString3, invalidString1) });
+ dataset.Add(null, new[] { string.Join(",", validString1, validString2, validString3) });
dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(";", invalidString1, validString1, validString2, validString3) });
dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(";", validString1, invalidString1, validString2, validString3) });
dataset.Add(new[] { header1, header2, header3 }.ToList(), new[] { string.Join(";", validString1, validString2, invalidString1, validString3) });
@@ -248,7 +260,7 @@ public void CookieHeaderValue_ParseList_AcceptsValidValues(IList cookies, string[] input)
{
var results = CookieHeaderValue.ParseStrictList(input);
@@ -267,7 +279,7 @@ public void CookieHeaderValue_TryParseList_AcceptsValidValues(IList cookies, string[] input)
{
var result = CookieHeaderValue.TryParseStrictList(input, out var results);
diff --git a/src/Http/Http/test/RequestCookiesCollectionTests.cs b/src/Http/Http/test/RequestCookiesCollectionTests.cs
index fa3fb6d67f74..4efca2c3c2d6 100644
--- a/src/Http/Http/test/RequestCookiesCollectionTests.cs
+++ b/src/Http/Http/test/RequestCookiesCollectionTests.cs
@@ -33,15 +33,22 @@ public void ParseManyCookies()
[Theory]
[InlineData(",", null)]
[InlineData(";", null)]
- [InlineData("er=dd,cc,bb", new[] { "dd" })]
- [InlineData("er=dd,err=cc,errr=bb", new[] { "dd", "cc", "bb" })]
- [InlineData("errorcookie=dd,:(\"sa;", new[] { "dd" })]
+ [InlineData("er=dd,cc,bb", null)]
+ [InlineData("er=dd,err=cc,errr=bb", null)]
+ [InlineData("errorcookie=dd,:(\"sa;", null)]
[InlineData("s;", null)]
+ [InlineData("a@a=a;", null)]
+ [InlineData("a@ a=a;", null)]
+ [InlineData("a a=a;", null)]
+ [InlineData(",a=a;", null)]
+ [InlineData(",a=a", null)]
+ [InlineData("a=a;,b=b", new []{ "a" })] // valid cookie followed by invalid cookie
+ [InlineData(",a=a;b=b", new[] { "b" })] // invalid cookie followed by valid cookie
public void ParseInvalidCookies(string cookieToParse, string[] expectedCookieValues)
{
var cookies = RequestCookieCollection.Parse(new StringValues(new[] { cookieToParse }));
- if(expectedCookieValues == null)
+ if (expectedCookieValues == null)
{
Assert.Equal(0, cookies.Count);
return;
diff --git a/src/Http/Shared/CookieHeaderParserShared.cs b/src/Http/Shared/CookieHeaderParserShared.cs
index e558ec1e4dc4..32f2e9b33b90 100644
--- a/src/Http/Shared/CookieHeaderParserShared.cs
+++ b/src/Http/Shared/CookieHeaderParserShared.cs
@@ -83,6 +83,17 @@ public static bool TryParseValue(StringSegment value, ref int index, bool suppor
if (!TryGetCookieLength(value, ref current, out parsedName, out parsedValue))
{
+ var separatorIndex = value.IndexOf(';', current);
+ if (separatorIndex > 0)
+ {
+ // Skip the invalid values and keep trying.
+ index = separatorIndex;
+ }
+ else
+ {
+ // No more separators, so we're done.
+ index = value.Length;
+ }
return false;
}
@@ -91,6 +102,17 @@ public static bool TryParseValue(StringSegment value, ref int index, bool suppor
// If we support multiple values and we've not reached the end of the string, then we must have a separator.
if ((separatorFound && !supportsMultipleValues) || (!separatorFound && (current < value.Length)))
{
+ var separatorIndex = value.IndexOf(';', current);
+ if (separatorIndex > 0)
+ {
+ // Skip the invalid values and keep trying.
+ index = separatorIndex;
+ }
+ else
+ {
+ // No more separators, so we're done.
+ index = value.Length;
+ }
return false;
}
@@ -106,7 +128,7 @@ private static int GetNextNonEmptyOrWhitespaceIndex(StringSegment input, int sta
separatorFound = false;
var current = startIndex + HttpRuleParser.GetWhitespaceLength(input, startIndex);
- if ((current == input.Length) || (input[current] != ',' && input[current] != ';'))
+ if (current == input.Length || input[current] != ';')
{
return current;
}
@@ -119,8 +141,8 @@ private static int GetNextNonEmptyOrWhitespaceIndex(StringSegment input, int sta
if (skipEmptyValues)
{
- // Most headers only split on ',', but cookies primarily split on ';'
- while ((current < input.Length) && ((input[current] == ',') || (input[current] == ';')))
+ // Cookies are split on ';'
+ while (current < input.Length && input[current] == ';')
{
current++; // skip delimiter.
current = current + HttpRuleParser.GetWhitespaceLength(input, current);
@@ -130,6 +152,18 @@ private static int GetNextNonEmptyOrWhitespaceIndex(StringSegment input, int sta
return current;
}
+ /*
+ * https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
+ * cookie-pair = cookie-name "=" cookie-value
+ * cookie-name = token
+ * token = 1*
+ separators = "(" | ")" | "<" | ">" | "@"
+ | "," | ";" | ":" | "\" | <">
+ | "/" | "[" | "]" | "?" | "="
+ | "{" | "}" | SP | HT
+ CTL =
+ */
// name=value; name="value"
internal static bool TryGetCookieLength(StringSegment input, ref int offset, [NotNullWhen(true)] out StringSegment? parsedName, [NotNullWhen(true)] out StringSegment? parsedValue)
{