diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs index 30444eec23..70ecc2f142 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs @@ -14,8 +14,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public sealed partial class HttpResponseHeaders : HttpHeaders { - private static readonly byte[] _CrLf = new[] { (byte)'\r', (byte)'\n' }; - private static readonly byte[] _colonSpace = new[] { (byte)':', (byte)' ' }; + private static ReadOnlySpan _CrLf => new[] { (byte)'\r', (byte)'\n' }; + private static ReadOnlySpan _colonSpace => new[] { (byte)':', (byte)' ' }; public Enumerator GetEnumerator() { diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs index 58b122cc4c..8c794b1f9d 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 public class Http2FrameWriter { // Literal Header Field without Indexing - Indexed Name (Index 8 - :status) - private static readonly byte[] _continueBytes = new byte[] { 0x08, 0x03, (byte)'1', (byte)'0', (byte)'0' }; + private static ReadOnlySpan _continueBytes => new byte[] { 0x08, 0x03, (byte)'1', (byte)'0', (byte)'0' }; private readonly object _writeLock = new object(); private readonly Http2Frame _outgoingFrame;