dotnet/runtime

Support cookie values with comma

Open

#58.773 geöffnet am 7. Sept. 2021

Auf GitHub ansehen
 (34 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)C# (5.445 Forks)batch import
area-System.Net.Httpbughelp wanted

Repository-Metriken

Stars
 (17.886 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 12T 11h) (661 gemergte PRs in 30 T)

Beschreibung

The following code will fail.

cookieContainer.Add(new Cookie("foo", "ba,r", "/", "example.com"));
---> System.Net.CookieException: The 'Value'='ba,r' part of the cookie is invalid.

This means that c# does not allow commas, but major browsers (Chrome, Firefox) do.

Chrome, Edge, and Firefox are the ones that allow commas. The combined market share of these browsers is probably over 90%. This means that allowing commas is a de facto standard.

My opinion is that we should follow the de facto standards, not the standardization bodies, because our goal is not to follow standards, but to solve real problems.

We need to face this.


Similar discussion in Golang: https://github.com/golang/go/issues/7243

Contributor Guide