Skip to content

Commit

Permalink
Change Load Order of AntiforgeryToken (OrchardCMS#3993)
Browse files Browse the repository at this point in the history
  • Loading branch information
deanmarcussen authored and sethcleaver committed Aug 12, 2019
1 parent 479f51e commit 39a12af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/OrchardCore/OrchardCore.Mvc.Core/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public override void ConfigureServices(IServiceCollection services)
var builder = services.AddMvc(options =>
{
// Forcing AntiForgery Token Validation on by default, it's only in Razor Pages by default
options.Filters.Add(typeof(AutoValidateAntiforgeryTokenAttribute), 1000);
// Load this filter after the MediaSizeFilterLimitAttribute, but before the
// IgnoreAntiforgeryTokenAttribute. refer : https://github.com/aspnet/AspNetCore/issues/10384
options.Filters.Add(typeof(AutoValidateAntiforgeryTokenAttribute), 999);

// Custom model binder to testing purpose
options.ModelBinderProviders.Insert(0, new CheckMarkModelBinderProvider());
Expand Down

0 comments on commit 39a12af

Please sign in to comment.