[System] HttpListenerRequest: ignore bad cookies and keep request alive (#5657)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 28 Sep 2017 23:19:09 +0000 (01:19 +0200)
committerGitHub <noreply@github.com>
Thu, 28 Sep 2017 23:19:09 +0000 (01:19 +0200)
commite3685c4c9aad38851097cff877dc0fb7ed47ab10
tree77e4b3fce25c6270e4332dee1a3f198ee0d21676
parenta17ae9ec7447555f1331b4831573ce66ffb01259
[System] HttpListenerRequest: ignore bad cookies and keep request alive (#5657)

HttpRequestListener throws on incorrect cookie name. It throws CookieException ("Name contains invalid characters"). There are many cookies out there that unfortunately do not conform to the guidelines and HttpRequestListener will kill the request in such a case. The .Net framework under windows lets the request through however.

Included is a patch HttpListenerRequest as well as a test with a bad cookie name.

I have tested this under linux(master branch) and .net (4.0), they now both have the same behavior.
mcs/class/System/System.Net/HttpListenerRequest.cs
mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs