Skip to content

Commit

Permalink
manual merge pass #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed Oct 2, 2018
1 parent 7349b54 commit edc9744
Show file tree
Hide file tree
Showing 22 changed files with 2,391 additions and 2,361 deletions.
17 changes: 0 additions & 17 deletions src/Umbraco.Core/Security/AuthenticationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,5 @@ internal static void EnsureCulture(this IIdentity identity)
/// </summary>
private static readonly ConcurrentDictionary<string, CultureInfo> UserCultures = new ConcurrentDictionary<string, CultureInfo>();

/// <summary>
/// Ensures that the thread culture is set based on the back office user's culture
/// </summary>
/// <param name="identity"></param>
internal static void EnsureCulture(this IIdentity identity)
{
if (identity is UmbracoBackOfficeIdentity umbIdentity && umbIdentity.IsAuthenticated)
{
Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture =
UserCultures.GetOrAdd(umbIdentity.Culture, s => new CultureInfo(s));
}
}
/// <summary>
/// Used so that we aren't creating a new CultureInfo object for every single request
/// </summary>
private static readonly ConcurrentDictionary<string, CultureInfo> UserCultures = new ConcurrentDictionary<string, CultureInfo>();
}
}
7 changes: 5 additions & 2 deletions src/Umbraco.Core/Services/Implement/PackagingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1442,15 +1442,18 @@ internal XElement Export(IMediaType mediaType)
/// <returns></returns>
public string FetchPackageFile(Guid packageId, Version umbracoVersion, int userId)
{
using (var httpClient = new HttpClient())
using (var scope = _scopeProvider.CreateScope())
{
//includeHidden = true because we don't care if it's hidden we want to get the file regardless
var url = $"{Constants.PackageRepository.RestApiBaseUrl}/{packageId}?version={umbracoVersion.ToString(3)}&includeHidden=true&asFile=true";
byte[] bytes;
try
{
bytes = httpClient.GetByteArrayAsync(url).GetAwaiter().GetResult();
if (_httpClient == null)
{
_httpClient = new HttpClient();
}
bytes = _httpClient.GetByteArrayAsync(url).GetAwaiter().GetResult();
}
catch (HttpRequestException ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ public void TouchServer(string serverAddress, string serverIdentity, TimeSpan st
// reload - cheap, cached

// default role is single server, but if registrations contain more
// than one active server, then role is master or slave
// than one active server, then role is master or replica
regs = _serverRegistrationRepository.GetMany().ToArray();

// default role is single server, but if registrations contain more
// than one active server, then role is master or slave
// than one active server, then role is master or replica
_currentServerRole = regs.Count(x => x.IsActive) > 1
? (server.IsMaster ? ServerRole.Master : ServerRole.Replica)
: ServerRole.Single;
Expand Down
3 changes: 3 additions & 0 deletions src/Umbraco.Tests/Umbraco.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
<PackageReference Include="AutoMapper" Version="7.0.1" />
<PackageReference Include="Castle.Core" Version="4.2.1" />
<PackageReference Include="Examine" Version="1.0.0-beta025" />
<PackageReference Include="HtmlAgilityPack">
<Version>1.8.9</Version>
</PackageReference>
<PackageReference Include="LightInject" Version="5.1.2" />
<PackageReference Include="LightInject.Annotation" Version="1.1.0" />
<PackageReference Include="Lucene.Net" Version="3.0.3" />
Expand Down
Loading

0 comments on commit edc9744

Please sign in to comment.