React to Cors api review changes
This commit is contained in:
parent
fd17481a73
commit
fbf66168fe
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.AspNet.Cors.Infrastructure;
|
||||
using Microsoft.AspNet.Mvc.ApplicationModels;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Cors
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.AspNet.Cors.Infrastructure;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Mvc.Filters;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
|
|
@ -98,7 +98,7 @@ namespace Microsoft.AspNet.Mvc.Cors
|
|||
private bool IsClosestToAction(IEnumerable<IFilterMetadata> filters)
|
||||
{
|
||||
// If there are multiple ICorsAuthorizationFilter which are defined at the class and
|
||||
// at the action level, the one closest to the action overrides the others.
|
||||
// at the action level, the one closest to the action overrides the others.
|
||||
// Since filterdescriptor collection is ordered (the last filter is the one closest to the action),
|
||||
// we apply this constraint only if there is no ICorsAuthorizationFilter after this.
|
||||
return filters.Last(filter => filter is ICorsAuthorizationFilter) == this;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.AspNet.Cors.Infrastructure;
|
||||
using Microsoft.AspNet.Mvc.ApplicationModels;
|
||||
using Microsoft.AspNet.Mvc.Cors;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.AspNet.Cors.Infrastructure;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Mvc.Filters;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"warningsAsErrors": true
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.Cors.Core": "6.0.0-*",
|
||||
"Microsoft.AspNet.Cors": "6.0.0-*",
|
||||
"Microsoft.AspNet.Mvc.Core": "6.0.0-*"
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.AspNet.Cors;
|
||||
using Microsoft.AspNet.Mvc.ApplicationModels;
|
||||
using Xunit;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.AspNet.Cors.Infrastructure;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Http.Internal;
|
||||
using Microsoft.AspNet.Mvc.Abstractions;
|
||||
|
|
@ -93,7 +93,7 @@ namespace Microsoft.AspNet.Mvc.Cors
|
|||
|
||||
[Fact]
|
||||
public async Task CorsRequest_FailedMatch_Writes200()
|
||||
{
|
||||
{
|
||||
// Arrange
|
||||
var mockEngine = GetFailingEngine();
|
||||
var filter = GetFilter(mockEngine);
|
||||
|
|
@ -129,7 +129,7 @@ namespace Microsoft.AspNet.Mvc.Cors
|
|||
RequestHeaders headers = null,
|
||||
bool isPreflight = false)
|
||||
{
|
||||
|
||||
|
||||
// HttpContext
|
||||
var httpContext = new DefaultHttpContext();
|
||||
if (headers != null)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
// 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 System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.AspNet.Cors.Infrastructure;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.FunctionalTests
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System.Linq;
|
|||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.AspNet.Cors.Infrastructure;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.FunctionalTests
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.AspNet.Cors;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
|
||||
namespace CorsWebSite
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Cors.Core;
|
||||
using Microsoft.AspNet.Cors.Infrastructure;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace CorsWebSite
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
|
||||
"Microsoft.AspNet.Cors.Core": "6.0.0-*",
|
||||
"Microsoft.AspNet.Cors": "6.0.0-*",
|
||||
"Microsoft.AspNet.Mvc": "6.0.0-*",
|
||||
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
|
||||
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
|
||||
|
|
|
|||
Loading…
Reference in New Issue