Use http method names from HttpAbstractions
This uses http method names from strings defined HttpMethods class instead of hard coded strings.
This commit is contained in:
parent
58411b4cc4
commit
e0e4b007ec
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// 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.
|
// 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;
|
using Microsoft.Net.Http.Headers;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Cors.Infrastructure
|
namespace Microsoft.AspNetCore.Cors.Infrastructure
|
||||||
|
|
@ -13,7 +14,7 @@ namespace Microsoft.AspNetCore.Cors.Infrastructure
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The HTTP method for the CORS preflight request.
|
/// The HTTP method for the CORS preflight request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string PreflightHttpMethod = "OPTIONS";
|
public static readonly string PreflightHttpMethod = HttpMethods.Options;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Origin request header.
|
/// The Origin request header.
|
||||||
|
|
@ -86,9 +87,9 @@ namespace Microsoft.AspNetCore.Cors.Infrastructure
|
||||||
|
|
||||||
internal static readonly string[] SimpleMethods =
|
internal static readonly string[] SimpleMethods =
|
||||||
{
|
{
|
||||||
"GET",
|
HttpMethods.Get,
|
||||||
"HEAD",
|
HttpMethods.Head,
|
||||||
"POST"
|
HttpMethods.Post
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue