* Fix for potential race condition in packages search (#13153) * search on input allowing to wait for copy/paste etc * invoke resourcePromise() with correct parameters * return the xhrStatus allowing the caller to check if the request was aborted * fix: send in canceler.promise to allow the timeout to work * catch any errors and ignore aborts if they happen * move the logic to handle cancellations outside Angulars $scope.$apply * remove file accidentally committed * V10: Fix request accessor memory leak (#13152) * Dispose OnChange event registration when disposing the notification handler * Ensure that the ApplicationUrl is only initialized once Since notifications handlers are transient,_hasAppUrl and _isInit defaults to false on every request causing it to always be called. * Make notification handler and EnsureApplicationUrl internal * Add missing ForceLeft and ForceRight (#13190) * Fix tags with CSV storage type (#13188) * Fixing null check as default(NRT) is null => default(configuration?.Delimiter) is also null and we were counting on it being the same as default(char) * Adding tests to check cases with multiple tags (or tag made of comma separated values) * Add data-element to umb property so we can find it (#13199) Co-authored-by: Zeegaan <nge@umbraco.dk> Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> Co-authored-by: Zeegaan <nge@umbraco.dk>
27 lines
992 B
C#
27 lines
992 B
C#
using Umbraco.Cms.Core.Events;
|
|
using Umbraco.Cms.Core.Notifications;
|
|
using Umbraco.Cms.Core.Web;
|
|
|
|
namespace Umbraco.Cms.Web.Common.AspNetCore;
|
|
|
|
/// <summary>
|
|
/// Notification handler which will listen to the <see cref="UmbracoRequestBeginNotification"/>, and ensure that
|
|
/// the applicationUrl is set on the first request.
|
|
/// </summary>
|
|
internal class ApplicationUrlRequestBeginNotificationHandler : INotificationHandler<UmbracoRequestBeginNotification>
|
|
{
|
|
private readonly IRequestAccessor _requestAccessor;
|
|
|
|
public ApplicationUrlRequestBeginNotificationHandler(IRequestAccessor requestAccessor) =>
|
|
_requestAccessor = requestAccessor;
|
|
|
|
public void Handle(UmbracoRequestBeginNotification notification)
|
|
{
|
|
// If someone has replaced the AspNetCoreRequestAccessor we'll do nothing and assume they handle it themselves.
|
|
if (_requestAccessor is AspNetCoreRequestAccessor accessor)
|
|
{
|
|
accessor.EnsureApplicationUrl();
|
|
}
|
|
}
|
|
}
|