Update ParseContentLength to remove unnecessary casting and unsafe
This commit is contained in:
parent
4da06e8acd
commit
859816bb53
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue