Reacting to HeaderUtitilities renames
This commit is contained in:
parent
568aaff9c4
commit
6ad9f3e8b0
|
|
@ -754,7 +754,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
StringValues value;
|
StringValues value;
|
||||||
if (_contentLength.HasValue)
|
if (_contentLength.HasValue)
|
||||||
{
|
{
|
||||||
value = new StringValues(HeaderUtilities.FormatInt64(_contentLength.Value));
|
value = new StringValues(HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value));
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
@ -1120,7 +1120,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
{
|
{
|
||||||
if (_contentLength.HasValue)
|
if (_contentLength.HasValue)
|
||||||
{
|
{
|
||||||
value = HeaderUtilities.FormatInt64(_contentLength.Value);
|
value = HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -3492,7 +3492,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
array[arrayIndex] = new KeyValuePair<string, StringValues>("Content-Length", HeaderUtilities.FormatInt64(_contentLength.Value));
|
array[arrayIndex] = new KeyValuePair<string, StringValues>("Content-Length", HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value));
|
||||||
++arrayIndex;
|
++arrayIndex;
|
||||||
}
|
}
|
||||||
((ICollection<KeyValuePair<string, StringValues>>)MaybeUnknown)?.CopyTo(array, arrayIndex);
|
((ICollection<KeyValuePair<string, StringValues>>)MaybeUnknown)?.CopyTo(array, arrayIndex);
|
||||||
|
|
@ -4767,7 +4767,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
state44:
|
state44:
|
||||||
if (_collection._contentLength.HasValue)
|
if (_collection._contentLength.HasValue)
|
||||||
{
|
{
|
||||||
_current = new KeyValuePair<string, StringValues>("Content-Length", HeaderUtilities.FormatInt64(_collection._contentLength.Value));
|
_current = new KeyValuePair<string, StringValues>("Content-Length", HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value));
|
||||||
_state = 45;
|
_state = 45;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -5399,7 +5399,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
StringValues value;
|
StringValues value;
|
||||||
if (_contentLength.HasValue)
|
if (_contentLength.HasValue)
|
||||||
{
|
{
|
||||||
value = new StringValues(HeaderUtilities.FormatInt64(_contentLength.Value));
|
value = new StringValues(HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value));
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
@ -5835,7 +5835,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
{
|
{
|
||||||
if (_contentLength.HasValue)
|
if (_contentLength.HasValue)
|
||||||
{
|
{
|
||||||
value = HeaderUtilities.FormatInt64(_contentLength.Value);
|
value = HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -7744,7 +7744,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
array[arrayIndex] = new KeyValuePair<string, StringValues>("Content-Length", HeaderUtilities.FormatInt64(_contentLength.Value));
|
array[arrayIndex] = new KeyValuePair<string, StringValues>("Content-Length", HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value));
|
||||||
++arrayIndex;
|
++arrayIndex;
|
||||||
}
|
}
|
||||||
((ICollection<KeyValuePair<string, StringValues>>)MaybeUnknown)?.CopyTo(array, arrayIndex);
|
((ICollection<KeyValuePair<string, StringValues>>)MaybeUnknown)?.CopyTo(array, arrayIndex);
|
||||||
|
|
@ -8970,7 +8970,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
state36:
|
state36:
|
||||||
if (_collection._contentLength.HasValue)
|
if (_collection._contentLength.HasValue)
|
||||||
{
|
{
|
||||||
_current = new KeyValuePair<string, StringValues>("Content-Length", HeaderUtilities.FormatInt64(_collection._contentLength.Value));
|
_current = new KeyValuePair<string, StringValues>("Content-Length", HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value));
|
||||||
_state = 37;
|
_state = 37;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
private static long ParseContentLength(string value)
|
private static long ParseContentLength(string value)
|
||||||
{
|
{
|
||||||
long parsed;
|
long parsed;
|
||||||
if (!HeaderUtilities.TryParseInt64(value, out parsed))
|
if (!HeaderUtilities.TryParseNonNegativeInt64(value, out parsed))
|
||||||
{
|
{
|
||||||
ThrowInvalidContentLengthException(value);
|
ThrowInvalidContentLengthException(value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
private static long ParseContentLength(string value)
|
private static long ParseContentLength(string value)
|
||||||
{
|
{
|
||||||
long parsed;
|
long parsed;
|
||||||
if (!HeaderUtilities.TryParseInt64(value, out parsed))
|
if (!HeaderUtilities.TryParseNonNegativeInt64(value, out parsed))
|
||||||
{
|
{
|
||||||
ThrowInvalidContentLengthException(value);
|
ThrowInvalidContentLengthException(value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests
|
||||||
|
|
||||||
frameHeaders.ContentLength = long.MaxValue;
|
frameHeaders.ContentLength = long.MaxValue;
|
||||||
Assert.True(headers.TryGetValue("Content-Length", out value));
|
Assert.True(headers.TryGetValue("Content-Length", out value));
|
||||||
Assert.Equal(HeaderUtilities.FormatInt64(long.MaxValue), value[0]);
|
Assert.Equal(HeaderUtilities.FormatNonNegativeInt64(long.MaxValue), value[0]);
|
||||||
Assert.Equal(long.MaxValue, frameHeaders.ContentLength);
|
Assert.Equal(long.MaxValue, frameHeaders.ContentLength);
|
||||||
Assert.True(frameHeaders.ContentLength.HasValue);
|
Assert.True(frameHeaders.ContentLength.HasValue);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -317,7 +317,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
StringValues value;
|
StringValues value;
|
||||||
if (_contentLength.HasValue)
|
if (_contentLength.HasValue)
|
||||||
{{
|
{{
|
||||||
value = new StringValues(HeaderUtilities.FormatInt64(_contentLength.Value));
|
value = new StringValues(HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value));
|
||||||
}}
|
}}
|
||||||
return value;
|
return value;
|
||||||
}}
|
}}
|
||||||
|
|
@ -363,7 +363,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
{{{(header.Identifier == "ContentLength" ? @"
|
{{{(header.Identifier == "ContentLength" ? @"
|
||||||
if (_contentLength.HasValue)
|
if (_contentLength.HasValue)
|
||||||
{
|
{
|
||||||
value = HeaderUtilities.FormatInt64(_contentLength.Value);
|
value = HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;" : $@"
|
return false;" : $@"
|
||||||
|
|
@ -513,7 +513,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
{{
|
{{
|
||||||
return false;
|
return false;
|
||||||
}}
|
}}
|
||||||
array[arrayIndex] = new KeyValuePair<string, StringValues>(""Content-Length"", HeaderUtilities.FormatInt64(_contentLength.Value));
|
array[arrayIndex] = new KeyValuePair<string, StringValues>(""Content-Length"", HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value));
|
||||||
++arrayIndex;
|
++arrayIndex;
|
||||||
}}
|
}}
|
||||||
((ICollection<KeyValuePair<string, StringValues>>)MaybeUnknown)?.CopyTo(array, arrayIndex);
|
((ICollection<KeyValuePair<string, StringValues>>)MaybeUnknown)?.CopyTo(array, arrayIndex);
|
||||||
|
|
@ -614,7 +614,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
state{loop.Headers.Count()}:
|
state{loop.Headers.Count()}:
|
||||||
if (_collection._contentLength.HasValue)
|
if (_collection._contentLength.HasValue)
|
||||||
{{
|
{{
|
||||||
_current = new KeyValuePair<string, StringValues>(""Content-Length"", HeaderUtilities.FormatInt64(_collection._contentLength.Value));
|
_current = new KeyValuePair<string, StringValues>(""Content-Length"", HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value));
|
||||||
_state = {loop.Headers.Count() + 1};
|
_state = {loop.Headers.Count() + 1};
|
||||||
return true;
|
return true;
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue