public void CookieParserGetString_SetCookieHeaderValue_Success(string cookieString) { var parser = new CookieParser(cookieString); string actual = parser.GetString(); Assert.Equal(cookieString, actual); }
internal static IEnumerable <string> GetCookiesFromHeader(string setCookieHeader) { List <string> cookieStrings = new List <string>(); try { CookieParser parser = new CookieParser(setCookieHeader); string cookieString; while ((cookieString = parser.GetString()) != null) { cookieStrings.Add(cookieString); } } catch (InternalCookieException) { // TODO (#7856): We should log this. But there isn't much we can do about it other // than to drop the rest of the cookies. } return(cookieStrings); }