-// Copyright (c) .NET Foundation. All rights reserved.
+// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0.
// See THIRD-PARTY-NOTICES.TXT in the project root for license information.
{
internal static class StatusCodes
{
+ // This uses C# compiler's ability to refer to static data directly. For more information see https://vcsjones.dev/2019/02/01/csharp-readonly-span-bytes-static
+
private static ReadOnlySpan<byte> BytesStatus100 => new byte[] { (byte)'1', (byte)'0', (byte)'0' };
private static ReadOnlySpan<byte> BytesStatus101 => new byte[] { (byte)'1', (byte)'0', (byte)'1' };
private static ReadOnlySpan<byte> BytesStatus102 => new byte[] { (byte)'1', (byte)'0', (byte)'2' };
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#if KESTREL
+using System;
+
+namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
+#else
namespace System.Net.Http
+#endif
{
- internal interface IHttpHeadersHandler
+#if KESTREL
+ public
+#else
+ internal
+#endif
+ interface IHttpHeadersHandler
{
void OnHeader(ReadOnlySpan<byte> name, ReadOnlySpan<byte> value);
void OnHeadersComplete(bool endStream);
}
-}
\ No newline at end of file
+}