parent
3fe17b9faf
commit
39c25357c6
|
|
@ -452,9 +452,15 @@ namespace Microsoft.Net.Http.Headers
|
||||||
result.HttpOnly = true;
|
result.HttpOnly = true;
|
||||||
}
|
}
|
||||||
// extension-av = <any CHAR except CTLs or ";">
|
// extension-av = <any CHAR except CTLs or ";">
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: skip it? Store it in a list?
|
// TODO: skiping it for now to avoid parsing failure? Store it in a list?
|
||||||
|
// = (no spaces)
|
||||||
|
if (!ReadEqualsSign(input, ref offset))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ReadToSemicolonOrEnd(input, ref offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -520,4 +526,4 @@ namespace Microsoft.Net.Http.Headers
|
||||||
^ HttpOnly.GetHashCode();
|
^ HttpOnly.GetHashCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -365,6 +365,18 @@ namespace Microsoft.Net.Http.Headers
|
||||||
Assert.Equal(cookies, results);
|
Assert.Equal(cookies, results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void SetCookieHeaderValue_TryParse_SkipExtensionValues()
|
||||||
|
{
|
||||||
|
string cookieHeaderValue = "cookiename=value; extensionname=value;";
|
||||||
|
|
||||||
|
SetCookieHeaderValue setCookieHeaderValue;
|
||||||
|
|
||||||
|
SetCookieHeaderValue.TryParse(cookieHeaderValue, out setCookieHeaderValue);
|
||||||
|
|
||||||
|
Assert.Equal("value", setCookieHeaderValue.Value);
|
||||||
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[MemberData(nameof(ListOfSetCookieHeaderDataSet))]
|
[MemberData(nameof(ListOfSetCookieHeaderDataSet))]
|
||||||
public void SetCookieHeaderValue_ParseStrictList_AcceptsValidValues(IList<SetCookieHeaderValue> cookies, string[] input)
|
public void SetCookieHeaderValue_ParseStrictList_AcceptsValidValues(IList<SetCookieHeaderValue> cookies, string[] input)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue