Skip to content

Commit e89535e

Browse files
committed
PR feedback
1 parent eb8022f commit e89535e

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/Http/Routing/src/Matching/HttpMethodMatcherPolicy.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ namespace Microsoft.AspNetCore.Routing.Matching
2020
public sealed class HttpMethodMatcherPolicy : MatcherPolicy, IEndpointComparerPolicy, INodeBuilderPolicy, IEndpointSelectorPolicy
2121
{
2222
// Used in tests
23-
internal const string OriginHeader = "Origin";
24-
internal const string AccessControlRequestMethod = "Access-Control-Request-Method";
2523
internal static readonly string PreflightHttpMethod = HttpMethods.Options;
2624

2725
// Used in tests

src/Http/Routing/test/UnitTests/Matching/HttpMethodMatcherPolicyIntegrationTestBase.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.AspNetCore.Http.Features;
99
using Microsoft.AspNetCore.Routing.Patterns;
1010
using Microsoft.Extensions.DependencyInjection;
11+
using Microsoft.Net.Http.Headers;
1112
using Xunit;
1213
using static Microsoft.AspNetCore.Routing.Matching.HttpMethodMatcherPolicy;
1314

@@ -352,8 +353,8 @@ internal static HttpContext CreateContext(
352353

353354
if (corsPreflight)
354355
{
355-
httpContext.Request.Headers[OriginHeader] = "example.com";
356-
httpContext.Request.Headers[AccessControlRequestMethod] = httpMethod;
356+
httpContext.Request.Headers[HeaderNames.Origin] = "example.com";
357+
httpContext.Request.Headers[HeaderNames.AccessControlRequestMethod] = httpMethod;
357358
}
358359

359360
return httpContext;

src/HttpClientFactory/Polly/src/HttpRequestMessageExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ namespace Polly
1313
/// </summary>
1414
public static class HttpRequestMessageExtensions
1515
{
16-
internal const string PolicyExecutionContextKey = "PolicyExecutionContext";
16+
#pragma warning disable CA1802 // Use literals where appropriate. Using a static field for reference equality
17+
internal static readonly string PolicyExecutionContextKey = "PolicyExecutionContext";
18+
#pragma warning restore CA1802
1719

1820
/// <summary>
1921
/// Gets the <see cref="Context"/> associated with the provided <see cref="HttpRequestMessage"/>.

src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ public static void ValidateHeaderNameCharacters(string headerCharacters)
291291
}
292292
}
293293

294-
private const string KeepAlive = "keep-alive";
294+
#pragma warning disable CA1802 // Use literals where appropriate. Using a static field for reference equality
295+
private static readonly string KeepAlive = "keep-alive";
296+
#pragma warning restore CA1802
295297
private readonly static StringValues ConnectionValueKeepAlive = KeepAlive;
296298
private readonly static StringValues ConnectionValueClose = "close";
297299
private readonly static StringValues ConnectionValueUpgrade = HeaderNames.Upgrade;

0 commit comments

Comments
 (0)