diff --git a/src/Microsoft.AspNetCore.Cors/Infrastructure/CorsConstants.cs b/src/Microsoft.AspNetCore.Cors/Infrastructure/CorsConstants.cs index bc8a994387..8028f9eb63 100644 --- a/src/Microsoft.AspNetCore.Cors/Infrastructure/CorsConstants.cs +++ b/src/Microsoft.AspNetCore.Cors/Infrastructure/CorsConstants.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Http; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Cors.Infrastructure @@ -13,7 +14,7 @@ namespace Microsoft.AspNetCore.Cors.Infrastructure /// /// The HTTP method for the CORS preflight request. /// - public static readonly string PreflightHttpMethod = "OPTIONS"; + public static readonly string PreflightHttpMethod = HttpMethods.Options; /// /// The Origin request header. @@ -86,9 +87,9 @@ namespace Microsoft.AspNetCore.Cors.Infrastructure internal static readonly string[] SimpleMethods = { - "GET", - "HEAD", - "POST" + HttpMethods.Get, + HttpMethods.Head, + HttpMethods.Post }; } } \ No newline at end of file