Skip to content

WebApi: if the HTTP request contains a cookie with an invalid character in the name, all cookies are ignored #118

@RobSiklos

Description

@RobSiklos

Let's say you have a cookie header like the following:

Cookie: c1=value1; c2=value2; invalid:cook=should_not_have_colon_in_name

The last cookie is invalid, because it has a colon character (:) in the name. At least according to https://gist.github.com/jeremiahlee/ff7dfb60572211dce306.

The problem is that when trying to read the cookies for such a request, GetCookies() (System.Net.Http.HttpRequestHeadersExtensions.GetCookies()) returns an empty set (with no error/warning message explaining why).

I would expect that at least the valid cookies would be returned (as is the case when trying to read the cookies from MVC, via HttpRequestBase.Cookies). Also, there should be a way to figure out why the cookies are missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions