Update ParseContentLength to remove unnecessary casting and unsafe

This commit is contained in:
John Luo 2016-12-09 11:39:25 -08:00
parent 4da06e8acd
commit 859816bb53
1 changed files with 2 additions and 2 deletions

View File

@ -233,10 +233,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
} }
} }
public static unsafe long ParseContentLength(StringValues value) public static long ParseContentLength(StringValues value)
{ {
long parsed; long parsed;
if (!HeaderUtilities.TryParseInt64(new StringSegment(value.ToString()), out parsed)) if (!HeaderUtilities.TryParseInt64(value.ToString(), out parsed))
{ {
ThrowInvalidContentLengthException(value); ThrowInvalidContentLengthException(value);
} }