React to hosting

This commit is contained in:
Hao Kung 2015-03-19 11:20:23 -07:00
parent 55af12b620
commit 7fe9aceb19
2 changed files with 15 additions and 15 deletions

View File

@ -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" }
},

View File

@ -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.