Skip to content

Commit

Permalink
Converted new test to new cors support.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfowl committed Jul 16, 2013
1 parent db05f8b commit 8b237d7
Showing 1 changed file with 23 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public static void ConfigureRoutes(IAppBuilder app, IDependencyResolver resolver
var hubConfig = new HubConfiguration
{
Resolver = resolver,
EnableCrossDomain = true,
EnableDetailedErrors = true
};

Expand All @@ -94,54 +93,39 @@ public static void ConfigureRoutes(IAppBuilder app, IDependencyResolver resolver
Resolver = resolver
});

var crossDomainConfig = new ConnectionConfiguration
var config = new ConnectionConfiguration
{
EnableCrossDomain = true,
Resolver = resolver
};

<<<<<<< HEAD
app.MapConnection<MySendingConnection>("/multisend", crossDomainConfig);
app.MapConnection<AutoEncodedJsonConnection>("/autoencodedjson", crossDomainConfig);
app.MapConnection<RedirectionConnection>("/redirectionConnection", crossDomainConfig);
=======
app.Map("/multisend", subApp =>
var corsOptions = new CorsOptions
{
app.UseCors(new CorsOptions
CorsPolicy = new CorsPolicy
{
CorsPolicy = new CorsPolicy
{
AllowAnyHeader = true,
AllowAnyMethod = true,
AllowAnyOrigin = true,
SupportsCredentials = true
}
});

subApp.UseConnection<MySendingConnection>(config);
AllowAnyHeader = true,
AllowAnyMethod = true,
AllowAnyOrigin = true,
SupportsCredentials = true
}
};

app.Map("/multisend", map =>
{
map.UseCors(corsOptions);
map.UseConnection<MySendingConnection>(config);
});
>>>>>>> Updated samples to use new cors middleware.

var config = new ConnectionConfiguration
app.Map("/autoencodedjson", map =>
{
<<<<<<< HEAD
Resolver = resolver
};
=======
app.UseCors(new CorsOptions
{
CorsPolicy = new CorsPolicy
{
AllowAnyHeader = true,
AllowAnyMethod = true,
AllowAnyOrigin = true,
SupportsCredentials = true
}
});

subApp.UseConnection<AutoEncodedJsonConnection>(config);
map.UseCors(corsOptions);
map.UseConnection<AutoEncodedJsonConnection>(config);
});

app.Map("/redirectionConnection", map =>
{
map.UseCors(corsOptions);
map.UseConnection<RedirectionConnection>(config);
});
>>>>>>> Updated samples to use new cors middleware.

app.MapConnection<MyBadConnection>("/ErrorsAreFun", config);
app.MapConnection<MyGroupEchoConnection>("/group-echo", config);
Expand Down

0 comments on commit 8b237d7

Please sign in to comment.