Remove value span usage (#12990)
This commit is contained in:
parent
4144eeb459
commit
3d9311a29f
|
|
@ -222,13 +222,11 @@ namespace Microsoft.AspNetCore.Http.Connections
|
|||
switch (reader.TokenType)
|
||||
{
|
||||
case JsonTokenType.PropertyName:
|
||||
var memberName = reader.ValueSpan;
|
||||
|
||||
if (memberName.SequenceEqual(TransportPropertyNameBytes.EncodedUtf8Bytes))
|
||||
if (reader.ValueTextEquals(TransportPropertyNameBytes.EncodedUtf8Bytes))
|
||||
{
|
||||
availableTransport.Transport = reader.ReadAsString(TransportPropertyName);
|
||||
}
|
||||
else if (memberName.SequenceEqual(TransferFormatsPropertyNameBytes.EncodedUtf8Bytes))
|
||||
else if (reader.ValueTextEquals(TransferFormatsPropertyNameBytes.EncodedUtf8Bytes))
|
||||
{
|
||||
reader.CheckRead();
|
||||
reader.EnsureArrayStart();
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ namespace Microsoft.AspNetCore.Http.Connections.Tests
|
|||
[InlineData("{\"url\": \"http://foo.com/chat\"}", null, null, "http://foo.com/chat", null)]
|
||||
[InlineData("{\"url\": \"http://foo.com/chat\", \"accessToken\": \"token\"}", null, null, "http://foo.com/chat", "token")]
|
||||
[InlineData("{\"connectionId\":\"123\",\"availableTransports\":[{\"transport\":\"test\",\"transferFormats\":[]}]}", "123", new[] { "test" }, null, null)]
|
||||
[InlineData("{\"connectionId\":\"123\",\"availableTransports\":[{\"\\u0074ransport\":\"test\",\"transferFormats\":[]}]}", "123", new[] { "test" }, null, null)]
|
||||
public void ParsingNegotiateResponseMessageSuccessForValid(string json, string connectionId, string[] availableTransports, string url, string accessToken)
|
||||
{
|
||||
var responseData = Encoding.UTF8.GetBytes(json);
|
||||
|
|
|
|||
Loading…
Reference in New Issue