* TryAddWithoutValidation ViaHeaderValue
* checking for 0
// If we reached the end of the string after reading protocolName/Version we return (we expect at least
// <receivedBy> to follow). If reading protocolName/Version read 0 bytes, we return.
- if ((current == startIndex) || (current == input.Length))
+ if ((current == 0) || (current == input.Length))
{
return 0;
}
Assert.Equal(expectedValues, headers.NonValidated["Accept"]);
}
+ [Fact]
+ public void TryAddWithoutValidation_AddInvalidViaHeaderValue_ValuePassed()
+ {
+ MockHeaders headers = new MockHeaders();
+ headers.TryAddWithoutValidation("Via", "1.1 foo.bar, foo");
+
+ Assert.Equal(1, headers.First().Value.Count());
+ Assert.Equal("1.1 foo.bar, foo", headers.First().Value.ElementAt(0));
+ }
+
[Theory]
[InlineData(null)]
[InlineData("")]