Skip to content

Test issue #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Tratcher opened this issue Feb 12, 2020 · 14 comments
Open

Test issue #1

Tratcher opened this issue Feb 12, 2020 · 14 comments

Comments

@Tratcher
Copy link
Owner

Tratcher commented Feb 12, 2020

This is a test issue for automation

@github-actions github-actions bot reopened this Feb 12, 2020
@github-actions
Copy link

Test message: The code is out of sync.

@github-actions
Copy link

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

</details>

@github-actions
Copy link

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

</details>

@github-actions
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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 github-actions bot reopened this Feb 13, 2020
@github-actions
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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<byte> 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 github-actions bot reopened this Feb 24, 2020
@github-actions
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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<byte> 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

2 similar comments
@github-actions
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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<byte> 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
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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<byte> 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
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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 <file>..." 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 @@
   <data name="net_http_request_invalid_char_encoding" xml:space="preserve">
     <value>Request headers must contain only ASCII characters.</value>
   </data>
+  <data name="net_quic_connectionaborted" xml:space="preserve">
+    <value>Connection aborted by peer ({0}).</value>
+  </data>
+  <data name="net_quic_notsupported" xml:space="preserve">
+    <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+  </data>
+  <data name="net_quic_operationaborted" xml:space="preserve">
+    <value>Operation aborted.</value>
+  </data>
+  <data name="net_quic_streamaborted" xml:space="preserve">
+    <value>Stream aborted by peer ({0}).</value>
+  </data>
 </root>
\ No newline at end of file

@github-actions
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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 <file>..." 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 @@
   <data name="net_http_request_invalid_char_encoding" xml:space="preserve">
     <value>Request headers must contain only ASCII characters.</value>
   </data>
+  <data name="net_quic_connectionaborted" xml:space="preserve">
+    <value>Connection aborted by peer ({0}).</value>
+  </data>
+  <data name="net_quic_notsupported" xml:space="preserve">
+    <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+  </data>
+  <data name="net_quic_operationaborted" xml:space="preserve">
+    <value>Operation aborted.</value>
+  </data>
+  <data name="net_quic_streamaborted" xml:space="preserve">
+    <value>Stream aborted by peer ({0}).</value>
+  </data>
 </root>
\ No newline at end of file

@github-actions
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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 <file>..." 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 @@
   <data name="net_http_request_invalid_char_encoding" xml:space="preserve">
     <value>Request headers must contain only ASCII characters.</value>
   </data>
+  <data name="net_quic_connectionaborted" xml:space="preserve">
+    <value>Connection aborted by peer ({0}).</value>
+  </data>
+  <data name="net_quic_notsupported" xml:space="preserve">
+    <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+  </data>
+  <data name="net_quic_operationaborted" xml:space="preserve">
+    <value>Operation aborted.</value>
+  </data>
+  <data name="net_quic_streamaborted" xml:space="preserve">
+    <value>Stream aborted by peer ({0}).</value>
+  </data>
 </root>
\ No newline at end of file

@github-actions
Copy link

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 <file>..." to update what will be committed)
  (use "git restore <file>..." 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 <file>..." 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 @@
   <data name="net_http_request_invalid_char_encoding" xml:space="preserve">
     <value>Request headers must contain only ASCII characters.</value>
   </data>
+  <data name="net_quic_connectionaborted" xml:space="preserve">
+    <value>Connection aborted by peer ({0}).</value>
+  </data>
+  <data name="net_quic_notsupported" xml:space="preserve">
+    <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+  </data>
+  <data name="net_quic_operationaborted" xml:space="preserve">
+    <value>Operation aborted.</value>
+  </data>
+  <data name="net_quic_streamaborted" xml:space="preserve">
+    <value>Stream aborted by peer ({0}).</value>
+  </data>
 </root>
\ No newline at end of file

Tratcher pushed a commit that referenced this issue Mar 19, 2021
…viderUsesContractResolver

Andremi/conversion result provider uses contract resolver
@Tratcher Tratcher reopened this Dec 7, 2021
Tratcher pushed a commit that referenced this issue Apr 14, 2023
…controller) (dotnet#46714)

* add dotnet new templates (razor view, api controller, mvc controller) (#1)

* added razor view

* fix identity for razor view item template

* added api controller

* fixed api, added mvc controller

* pr comment fixes

* PR comment fixes 2

* fixing postActions.description

* changed encoding for razor view Index.cshtml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant