Ensures that the thread culture is set both in owin and in aspnet

This commit is contained in:
Shannon
2018-04-05 18:11:15 +10:00
parent a62422fac3
commit 9bfe9e6bbf
3 changed files with 37 additions and 16 deletions

View File

@@ -1,8 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading;
using System.Web;
using System.Web.Routing;
using LightInject;
@@ -15,6 +17,7 @@ using Umbraco.Web.Security;
using Umbraco.Core.Collections;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Persistence;
using Umbraco.Core.Security;
using Umbraco.Core.Services;
using Umbraco.Web.Composing;
using Umbraco.Web.PublishedCache;
@@ -562,6 +565,13 @@ namespace Umbraco.Web
}
};
app.PostAuthenticateRequest += (sender, e) =>
{
var httpContext = ((HttpApplication) sender).Context;
//ensure the thread culture is set
httpContext.User?.Identity?.EnsureCulture();
};
app.PostResolveRequestCache += (sender, e) =>
{
var httpContext = ((HttpApplication) sender).Context;