aspnet / HttpAbstractions

[Archived] HTTP abstractions such as HttpRequest, HttpResponse, and HttpContext, as well as common web utilities. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
382 stars 193 forks source link

GetSetCookieLength method is not parsing correctly when cookie has invalid keyvalue pair #1049

Closed dhmuralikrishna closed 6 years ago

dhmuralikrishna commented 6 years ago

Lets say set-cookie value is cookiename=cookievalue; Version=1; Domain=.contoso.com; Path=/; Secure; HttpOnly";

Then it's not parsing to SetcookieHeaderValue in SetcookieHeaderValue.TryParse is returning null.

Version =1 might not be valid as per the spec. But other non-windows servers are sending the cookie like that.

Expected Ignore Version =1 and fill remaining values in SetCookieHeaderValue.

Tratcher commented 6 years ago

Where are you getting cookies like this from?

dhmuralikrishna commented 6 years ago

From one of the dependent systems.

Tratcher commented 6 years ago

What kind of server / software is creating a cookie with that format?

dhmuralikrishna commented 6 years ago

I think its java app don't know much details. we are consuming https endpoint int he response set-cookie it has version=1