From 5a64688d8e192cacffda9440e8725c1ed41a30cf Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Tue, 25 Dec 2018 00:53:07 +0000 Subject: [PATCH] Make some ThrowHelpers static (#5951) --- src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.cs | 8 ++++---- .../Kestrel/Core/src/Internal/Http/HttpProtocol.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.cs index 6acb332a26..ceb017ad28 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.cs @@ -77,22 +77,22 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } } - protected void ThrowHeadersReadOnlyException() + protected static void ThrowHeadersReadOnlyException() { throw new InvalidOperationException(CoreStrings.HeadersAreReadOnly); } - protected void ThrowArgumentException() + protected static void ThrowArgumentException() { throw new ArgumentException(); } - protected void ThrowKeyNotFoundException() + protected static void ThrowKeyNotFoundException() { throw new KeyNotFoundException(); } - protected void ThrowDuplicateKeyException() + protected static void ThrowDuplicateKeyException() { throw new ArgumentException(CoreStrings.KeyAlreadyExists); } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs index 3309701e0a..72bedf1be6 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs @@ -1204,7 +1204,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http statusCode != StatusCodes.Status304NotModified; } - private void ThrowResponseAlreadyStartedException(string value) + private static void ThrowResponseAlreadyStartedException(string value) { throw new InvalidOperationException(CoreStrings.FormatParameterReadOnlyAfterResponseStarted(value)); }