Tratcher / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
0 stars 0 forks source link

Test issue #1

Open Tratcher opened 4 years ago

Tratcher commented 4 years ago

This is a test issue for automation

github-actions[bot] commented 4 years ago

Test message: The code is out of sync.

github-actions[bot] commented 4 years ago
The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/CopyToAspNetCore.cmd no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/CopyToAspNetCore.cmd b/src/Shared/runtime/CopyToAspNetCore.cmd index 43eb681..65a341b 100644 --- a/src/Shared/runtime/CopyToAspNetCore.cmd +++ b/src/Shared/runtime/CopyToAspNetCore.cmd @@ -10,5 +10,6 @@ IF [%remote_repo%] == [] ( echo ASPNETCORE_REPO: %remote_repo% -robocopy . %remote_repo%\src\Shared\runtime /MIR -robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR +REM https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code +(robocopy . %remote_repo%\src\Shared\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 +(robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/CopyToAspNetCore.cmd no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/CopyToAspNetCore.cmd b/src/Shared/runtime/CopyToAspNetCore.cmd index 43eb681..65a341b 100644 --- a/src/Shared/runtime/CopyToAspNetCore.cmd +++ b/src/Shared/runtime/CopyToAspNetCore.cmd @@ -10,5 +10,6 @@ IF [%remote_repo%] == [] ( echo ASPNETCORE_REPO: %remote_repo% -robocopy . %remote_repo%\src\Shared\runtime /MIR -robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR +REM https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code +(robocopy . %remote_repo%\src\Shared\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 +(robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/CopyToAspNetCore.cmd no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/CopyToAspNetCore.cmd b/src/Shared/runtime/CopyToAspNetCore.cmd index 43eb681..65a341b 100644 --- a/src/Shared/runtime/CopyToAspNetCore.cmd +++ b/src/Shared/runtime/CopyToAspNetCore.cmd @@ -10,5 +10,6 @@ IF [%remote_repo%] == [] ( echo ASPNETCORE_REPO: %remote_repo% -robocopy . %remote_repo%\src\Shared\runtime /MIR -robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR +REM https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code +(robocopy . %remote_repo%\src\Shared\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 +(robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/CopyToAspNetCore.cmd no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/CopyToAspNetCore.cmd b/src/Shared/runtime/CopyToAspNetCore.cmd index 43eb681..65a341b 100644 --- a/src/Shared/runtime/CopyToAspNetCore.cmd +++ b/src/Shared/runtime/CopyToAspNetCore.cmd @@ -10,5 +10,6 @@ IF [%remote_repo%] == [] ( echo ASPNETCORE_REPO: %remote_repo% -robocopy . %remote_repo%\src\Shared\runtime /MIR -robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR +REM https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code +(robocopy . %remote_repo%\src\Shared\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 +(robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/CopyToAspNetCore.cmd modified: src/Shared/runtime/CopyToRuntime.cmd modified: src/Shared/runtime/Http3/QPack/QPackDecoder.cs no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/CopyToAspNetCore.cmd b/src/Shared/runtime/CopyToAspNetCore.cmd index 43eb681..65a341b 100644 --- a/src/Shared/runtime/CopyToAspNetCore.cmd +++ b/src/Shared/runtime/CopyToAspNetCore.cmd @@ -10,5 +10,6 @@ IF [%remote_repo%] == [] ( echo ASPNETCORE_REPO: %remote_repo% -robocopy . %remote_repo%\src\Shared\runtime /MIR -robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR +REM https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code +(robocopy . %remote_repo%\src\Shared\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 +(robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 diff --git a/src/Shared/runtime/CopyToRuntime.cmd b/src/Shared/runtime/CopyToRuntime.cmd index 7f9e5b1..f1cb32d 100644 --- a/src/Shared/runtime/CopyToRuntime.cmd +++ b/src/Shared/runtime/CopyToRuntime.cmd @@ -10,5 +10,6 @@ IF [%remote_repo%] == [] ( echo RUNTIME_REPO: %remote_repo% -robocopy . %remote_repo%\src\libraries\Common\src\System\Net\Http\aspnetcore /MIR -robocopy .\..\test\Shared.Tests\runtime %remote_repo%\src\libraries\Common\tests\Tests\System\Net\aspnetcore /MIR +REM https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code +(robocopy . %remote_repo%\src\libraries\Common\src\System\Net\Http\aspnetcore /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 +(robocopy .\..\test\Shared.Tests\runtime %remote_repo%\src\libraries\Common\tests\Tests\System\Net\aspnetcore /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 diff --git a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs index dfde487..958dfac 100644 --- a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs +++ b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs @@ -224,7 +224,7 @@ namespace System.Net.Http.QPack } break; case State.CompressedHeaders: - switch (BitOperations.LeadingZeroCount(b) - 24) + switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s. { case 0: // Indexed Header Field prefixInt = IndexedHeaderFieldPrefixMask & b; @@ -269,6 +269,10 @@ namespace System.Net.Http.QPack if (_integerDecoder.BeginTryDecode((byte)prefixInt, LiteralHeaderFieldWithoutNameReferencePrefix, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, State.HeaderName); } else @@ -303,6 +307,10 @@ namespace System.Net.Http.QPack case State.HeaderNameLength: if (_integerDecoder.TryDecode(b, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, nextState: State.HeaderName); } break; ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs index 536968b..00ca779 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs @@ -402,7 +402,7 @@ namespace System.Net.Quic.Implementations.MsQuic { ThrowIfDisposed(); - return ReadAsync(buffer.ToArray()).GetAwaiter().GetResult(); + return ReadAsync(buffer.ToArray()).AsTask().GetAwaiter().GetResult(); } internal override void Write(ReadOnlySpan buffer) @@ -410,7 +410,7 @@ namespace System.Net.Quic.Implementations.MsQuic ThrowIfDisposed(); // TODO: optimize this. - WriteAsync(buffer.ToArray()).GetAwaiter().GetResult(); + WriteAsync(buffer.ToArray()).AsTask().GetAwaiter().GetResult(); } // MsQuic doesn't support explicit flushing ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs index 536968b..00ca779 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs @@ -402,7 +402,7 @@ namespace System.Net.Quic.Implementations.MsQuic { ThrowIfDisposed(); - return ReadAsync(buffer.ToArray()).GetAwaiter().GetResult(); + return ReadAsync(buffer.ToArray()).AsTask().GetAwaiter().GetResult(); } internal override void Write(ReadOnlySpan buffer) @@ -410,7 +410,7 @@ namespace System.Net.Quic.Implementations.MsQuic ThrowIfDisposed(); // TODO: optimize this. - WriteAsync(buffer.ToArray()).GetAwaiter().GetResult(); + WriteAsync(buffer.ToArray()).AsTask().GetAwaiter().GetResult(); } // MsQuic doesn't support explicit flushing ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs index 536968b..00ca779 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs @@ -402,7 +402,7 @@ namespace System.Net.Quic.Implementations.MsQuic { ThrowIfDisposed(); - return ReadAsync(buffer.ToArray()).GetAwaiter().GetResult(); + return ReadAsync(buffer.ToArray()).AsTask().GetAwaiter().GetResult(); } internal override void Write(ReadOnlySpan buffer) @@ -410,7 +410,7 @@ namespace System.Net.Quic.Implementations.MsQuic ThrowIfDisposed(); // TODO: optimize this. - WriteAsync(buffer.ToArray()).GetAwaiter().GetResult(); + WriteAsync(buffer.ToArray()).AsTask().GetAwaiter().GetResult(); } // MsQuic doesn't support explicit flushing ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs index 536968b..00ca779 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs @@ -402,7 +402,7 @@ namespace System.Net.Quic.Implementations.MsQuic { ThrowIfDisposed(); - return ReadAsync(buffer.ToArray()).GetAwaiter().GetResult(); + return ReadAsync(buffer.ToArray()).AsTask().GetAwaiter().GetResult(); } internal override void Write(ReadOnlySpan buffer) @@ -410,7 +410,7 @@ namespace System.Net.Quic.Implementations.MsQuic ThrowIfDisposed(); // TODO: optimize this. - WriteAsync(buffer.ToArray()).GetAwaiter().GetResult(); + WriteAsync(buffer.ToArray()).AsTask().GetAwaiter().GetResult(); } // MsQuic doesn't support explicit flushing ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/Http2/Hpack/HPackDecoder.cs modified: src/Shared/runtime/Http2/Hpack/HeaderField.cs modified: src/Shared/runtime/Http3/QPack/QPackDecoder.cs modified: src/Shared/runtime/SR.resx Untracked files: (use "git add ..." to include in what will be committed) src/Shared/runtime/NetEventSource.Common.cs src/Shared/runtime/Quic/ src/Shared/runtime/SR.Quic.cs no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs index 98fb416..997047f 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs @@ -12,7 +12,7 @@ namespace System.Net.Http.HPack { internal class HPackDecoder { - private enum State + private enum State : byte { Ready, HeaderFieldIndex, diff --git a/src/Shared/runtime/Http2/Hpack/HeaderField.cs b/src/Shared/runtime/Http2/Hpack/HeaderField.cs index 1eba824..f876204 100644 --- a/src/Shared/runtime/Http2/Hpack/HeaderField.cs +++ b/src/Shared/runtime/Http2/Hpack/HeaderField.cs @@ -21,11 +21,8 @@ namespace System.Net.Http.HPack // We should revisit our allocation strategy here so we don't need to allocate per entry // and we have a cap to how much allocation can happen per dynamic table // (without limiting the number of table entries a server can provide within the table size limit). - Name = new byte[name.Length]; - name.CopyTo(Name); - - Value = new byte[value.Length]; - value.CopyTo(Value); + Name = name.ToArray(); + Value = value.ToArray(); } public byte[] Name { get; } diff --git a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs index 6f63d66..958dfac 100644 --- a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs +++ b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs @@ -269,6 +269,10 @@ namespace System.Net.Http.QPack if (_integerDecoder.BeginTryDecode((byte)prefixInt, LiteralHeaderFieldWithoutNameReferencePrefix, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, State.HeaderName); } else @@ -303,6 +307,10 @@ namespace System.Net.Http.QPack case State.HeaderNameLength: if (_integerDecoder.TryDecode(b, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, nextState: State.HeaderName); } break; diff --git a/src/Shared/runtime/SR.resx b/src/Shared/runtime/SR.resx index bcd721a..c6c8b9b 100644 --- a/src/Shared/runtime/SR.resx +++ b/src/Shared/runtime/SR.resx @@ -156,4 +156,16 @@ Request headers must contain only ASCII characters. + + Connection aborted by peer ({0}). + + + QUIC is not supported on this platform. See http://aka.ms/dotnetquic + + + Operation aborted. + + + Stream aborted by peer ({0}). + \ No newline at end of file ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/Http2/Hpack/HPackDecoder.cs modified: src/Shared/runtime/Http2/Hpack/HeaderField.cs modified: src/Shared/runtime/Http3/QPack/QPackDecoder.cs modified: src/Shared/runtime/SR.resx Untracked files: (use "git add ..." to include in what will be committed) src/Shared/runtime/NetEventSource.Common.cs src/Shared/runtime/Quic/ src/Shared/runtime/SR.Quic.cs no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs index 98fb416..997047f 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs @@ -12,7 +12,7 @@ namespace System.Net.Http.HPack { internal class HPackDecoder { - private enum State + private enum State : byte { Ready, HeaderFieldIndex, diff --git a/src/Shared/runtime/Http2/Hpack/HeaderField.cs b/src/Shared/runtime/Http2/Hpack/HeaderField.cs index 1eba824..f876204 100644 --- a/src/Shared/runtime/Http2/Hpack/HeaderField.cs +++ b/src/Shared/runtime/Http2/Hpack/HeaderField.cs @@ -21,11 +21,8 @@ namespace System.Net.Http.HPack // We should revisit our allocation strategy here so we don't need to allocate per entry // and we have a cap to how much allocation can happen per dynamic table // (without limiting the number of table entries a server can provide within the table size limit). - Name = new byte[name.Length]; - name.CopyTo(Name); - - Value = new byte[value.Length]; - value.CopyTo(Value); + Name = name.ToArray(); + Value = value.ToArray(); } public byte[] Name { get; } diff --git a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs index 6f63d66..958dfac 100644 --- a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs +++ b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs @@ -269,6 +269,10 @@ namespace System.Net.Http.QPack if (_integerDecoder.BeginTryDecode((byte)prefixInt, LiteralHeaderFieldWithoutNameReferencePrefix, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, State.HeaderName); } else @@ -303,6 +307,10 @@ namespace System.Net.Http.QPack case State.HeaderNameLength: if (_integerDecoder.TryDecode(b, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, nextState: State.HeaderName); } break; diff --git a/src/Shared/runtime/SR.resx b/src/Shared/runtime/SR.resx index bcd721a..c6c8b9b 100644 --- a/src/Shared/runtime/SR.resx +++ b/src/Shared/runtime/SR.resx @@ -156,4 +156,16 @@ Request headers must contain only ASCII characters. + + Connection aborted by peer ({0}). + + + QUIC is not supported on this platform. See http://aka.ms/dotnetquic + + + Operation aborted. + + + Stream aborted by peer ({0}). + \ No newline at end of file ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/Http2/Hpack/HPackDecoder.cs modified: src/Shared/runtime/Http2/Hpack/HeaderField.cs modified: src/Shared/runtime/Http3/QPack/QPackDecoder.cs modified: src/Shared/runtime/SR.resx Untracked files: (use "git add ..." to include in what will be committed) src/Shared/runtime/NetEventSource.Common.cs src/Shared/runtime/Quic/ src/Shared/runtime/SR.Quic.cs no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs index 98fb416..997047f 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs @@ -12,7 +12,7 @@ namespace System.Net.Http.HPack { internal class HPackDecoder { - private enum State + private enum State : byte { Ready, HeaderFieldIndex, diff --git a/src/Shared/runtime/Http2/Hpack/HeaderField.cs b/src/Shared/runtime/Http2/Hpack/HeaderField.cs index 1eba824..f876204 100644 --- a/src/Shared/runtime/Http2/Hpack/HeaderField.cs +++ b/src/Shared/runtime/Http2/Hpack/HeaderField.cs @@ -21,11 +21,8 @@ namespace System.Net.Http.HPack // We should revisit our allocation strategy here so we don't need to allocate per entry // and we have a cap to how much allocation can happen per dynamic table // (without limiting the number of table entries a server can provide within the table size limit). - Name = new byte[name.Length]; - name.CopyTo(Name); - - Value = new byte[value.Length]; - value.CopyTo(Value); + Name = name.ToArray(); + Value = value.ToArray(); } public byte[] Name { get; } diff --git a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs index 6f63d66..958dfac 100644 --- a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs +++ b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs @@ -269,6 +269,10 @@ namespace System.Net.Http.QPack if (_integerDecoder.BeginTryDecode((byte)prefixInt, LiteralHeaderFieldWithoutNameReferencePrefix, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, State.HeaderName); } else @@ -303,6 +307,10 @@ namespace System.Net.Http.QPack case State.HeaderNameLength: if (_integerDecoder.TryDecode(b, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, nextState: State.HeaderName); } break; diff --git a/src/Shared/runtime/SR.resx b/src/Shared/runtime/SR.resx index bcd721a..c6c8b9b 100644 --- a/src/Shared/runtime/SR.resx +++ b/src/Shared/runtime/SR.resx @@ -156,4 +156,16 @@ Request headers must contain only ASCII characters. + + Connection aborted by peer ({0}). + + + QUIC is not supported on this platform. See http://aka.ms/dotnetquic + + + Operation aborted. + + + Stream aborted by peer ({0}). + \ No newline at end of file ```
github-actions[bot] commented 4 years ago

The shared code is out of sync.

The Diff ``` On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: src/Shared/runtime/Http2/Hpack/HPackDecoder.cs modified: src/Shared/runtime/Http2/Hpack/HeaderField.cs modified: src/Shared/runtime/Http3/QPack/QPackDecoder.cs modified: src/Shared/runtime/SR.resx Untracked files: (use "git add ..." to include in what will be committed) src/Shared/runtime/NetEventSource.Common.cs src/Shared/runtime/Quic/ src/Shared/runtime/SR.Quic.cs no changes added to commit (use "git add" and/or "git commit -a") diff --git a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs index 98fb416..997047f 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs @@ -12,7 +12,7 @@ namespace System.Net.Http.HPack { internal class HPackDecoder { - private enum State + private enum State : byte { Ready, HeaderFieldIndex, diff --git a/src/Shared/runtime/Http2/Hpack/HeaderField.cs b/src/Shared/runtime/Http2/Hpack/HeaderField.cs index 1eba824..f876204 100644 --- a/src/Shared/runtime/Http2/Hpack/HeaderField.cs +++ b/src/Shared/runtime/Http2/Hpack/HeaderField.cs @@ -21,11 +21,8 @@ namespace System.Net.Http.HPack // We should revisit our allocation strategy here so we don't need to allocate per entry // and we have a cap to how much allocation can happen per dynamic table // (without limiting the number of table entries a server can provide within the table size limit). - Name = new byte[name.Length]; - name.CopyTo(Name); - - Value = new byte[value.Length]; - value.CopyTo(Value); + Name = name.ToArray(); + Value = value.ToArray(); } public byte[] Name { get; } diff --git a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs index 6f63d66..958dfac 100644 --- a/src/Shared/runtime/Http3/QPack/QPackDecoder.cs +++ b/src/Shared/runtime/Http3/QPack/QPackDecoder.cs @@ -269,6 +269,10 @@ namespace System.Net.Http.QPack if (_integerDecoder.BeginTryDecode((byte)prefixInt, LiteralHeaderFieldWithoutNameReferencePrefix, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, State.HeaderName); } else @@ -303,6 +307,10 @@ namespace System.Net.Http.QPack case State.HeaderNameLength: if (_integerDecoder.TryDecode(b, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, nextState: State.HeaderName); } break; diff --git a/src/Shared/runtime/SR.resx b/src/Shared/runtime/SR.resx index bcd721a..c6c8b9b 100644 --- a/src/Shared/runtime/SR.resx +++ b/src/Shared/runtime/SR.resx @@ -156,4 +156,16 @@ Request headers must contain only ASCII characters. + + Connection aborted by peer ({0}). + + + QUIC is not supported on this platform. See http://aka.ms/dotnetquic + + + Operation aborted. + + + Stream aborted by peer ({0}). + \ No newline at end of file ```