From e0e4b007ec1a73468a12e4dbb2333ef5348dfaad Mon Sep 17 00:00:00 2001 From: Priyanshu Agrawal Date: Sat, 3 Feb 2018 01:36:28 +0530 Subject: [PATCH] Use http method names from HttpAbstractions This uses http method names from strings defined HttpMethods class instead of hard coded strings. --- .../Infrastructure/CorsConstants.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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