React to hosting
This commit is contained in:
parent
55af12b620
commit
7fe9aceb19
|
|
@ -2,7 +2,7 @@
|
|||
"version": "1.0.0-*",
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.Cors.Core": "1.0.0-*",
|
||||
"Microsoft.AspNet.RequestContainer": "1.0.0-*",
|
||||
"Microsoft.AspNet.Hosting": "1.0.0-*",
|
||||
"Microsoft.AspNet.WebUtilities": "1.0.0-*",
|
||||
"Microsoft.Framework.NotNullAttribute.Internal": { "version": "1.0.0-*", "type": "build" }
|
||||
},
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ namespace Microsoft.AspNet.Cors.Test
|
|||
// Arrange
|
||||
using (var server = TestServer.Create(app =>
|
||||
{
|
||||
app.UseServices(services => services.AddCors());
|
||||
app.UseCors(builder =>
|
||||
builder.WithOrigins("http://localhost:5001")
|
||||
.WithMethods("PUT")
|
||||
|
|
@ -33,7 +32,8 @@ namespace Microsoft.AspNet.Cors.Test
|
|||
{
|
||||
await context.Response.WriteAsync("Cross origin response");
|
||||
});
|
||||
}))
|
||||
},
|
||||
services => services.AddCors()))
|
||||
{
|
||||
// Act
|
||||
// Actual request.
|
||||
|
|
@ -62,19 +62,19 @@ namespace Microsoft.AspNet.Cors.Test
|
|||
|
||||
using (var server = TestServer.Create(app =>
|
||||
{
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddCors();
|
||||
services.ConfigureCors(options =>
|
||||
{
|
||||
options.AddPolicy("customPolicy", policy);
|
||||
});
|
||||
});
|
||||
app.UseCors("customPolicy");
|
||||
app.Run(async context =>
|
||||
{
|
||||
await context.Response.WriteAsync("Cross origin response");
|
||||
});
|
||||
},
|
||||
services =>
|
||||
{
|
||||
services.AddCors();
|
||||
services.ConfigureCors(options =>
|
||||
{
|
||||
options.AddPolicy("customPolicy", policy);
|
||||
});
|
||||
}))
|
||||
{
|
||||
// Act
|
||||
|
|
@ -98,7 +98,6 @@ namespace Microsoft.AspNet.Cors.Test
|
|||
// Arrange
|
||||
using (var server = TestServer.Create(app =>
|
||||
{
|
||||
app.UseServices(services => services.AddCors());
|
||||
app.UseCors(builder =>
|
||||
builder.WithOrigins("http://localhost:5001")
|
||||
.WithMethods("PUT")
|
||||
|
|
@ -108,7 +107,8 @@ namespace Microsoft.AspNet.Cors.Test
|
|||
{
|
||||
await context.Response.WriteAsync("Cross origin response");
|
||||
});
|
||||
}))
|
||||
},
|
||||
services => services.AddCors()))
|
||||
{
|
||||
// Act
|
||||
// Preflight request.
|
||||
|
|
@ -129,7 +129,6 @@ namespace Microsoft.AspNet.Cors.Test
|
|||
// Arrange
|
||||
using (var server = TestServer.Create(app =>
|
||||
{
|
||||
app.UseServices(services => services.AddCors());
|
||||
app.UseCors(builder =>
|
||||
builder.WithOrigins("http://localhost:5001")
|
||||
.WithMethods("PUT")
|
||||
|
|
@ -139,7 +138,8 @@ namespace Microsoft.AspNet.Cors.Test
|
|||
{
|
||||
await context.Response.WriteAsync("Cross origin response");
|
||||
});
|
||||
}))
|
||||
},
|
||||
services => services.AddCors()))
|
||||
{
|
||||
// Act
|
||||
// Actual request.
|
||||
|
|
|
|||
Loading…
Reference in New Issue