From 92595ccc354aea6a5bfd32050770eedec14a0117 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Mon, 17 Jul 2023 11:49:06 -0400 Subject: [PATCH 1/2] prevent client looping if server is down --- Oqtane.Client/Services/ServiceBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Oqtane.Client/Services/ServiceBase.cs b/Oqtane.Client/Services/ServiceBase.cs index 54c66d7e..f12c0278 100644 --- a/Oqtane.Client/Services/ServiceBase.cs +++ b/Oqtane.Client/Services/ServiceBase.cs @@ -66,7 +66,7 @@ namespace Oqtane.Services // legacy support for ControllerRoutes.Default if (alias != null) { - // include the alias for multi-tenant context + // include the alias id for multi-tenant context apiurl += $"{alias.AliasId}/"; } else @@ -223,7 +223,7 @@ namespace Oqtane.Services private async Task Log(string uri, string method, string status, string message, params object[] args) { - if (_siteState.Alias != null) + if (_siteState.Alias != null && !uri.StartsWith(CreateApiUrl("Log"))) { var log = new Log(); log.SiteId = _siteState.Alias.SiteId; From 100b92036bd6e097f50f15ab57f39f1343997860 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Mon, 17 Jul 2023 16:59:40 -0400 Subject: [PATCH 2/2] use html line breaks in error log notifications --- Oqtane.Server/Infrastructure/LogManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Oqtane.Server/Infrastructure/LogManager.cs b/Oqtane.Server/Infrastructure/LogManager.cs index 900f5e91..27d4df50 100644 --- a/Oqtane.Server/Infrastructure/LogManager.cs +++ b/Oqtane.Server/Infrastructure/LogManager.cs @@ -210,7 +210,7 @@ namespace Oqtane.Infrastructure { var subject = $"{alias.Name} Site {log.Level} Notification"; var url = $"{_accessor.HttpContext.Request.Scheme}://{alias.Name}/admin/log?id={log.LogId}"; - string body = $"Log Message: {log.Message}\n\nPlease visit {url} for more information"; + string body = $"Log Message: {log.Message}

Please visit {url} for more information"; var notification = new Notification(log.SiteId.Value, userrole.User, subject, body); _notifications.AddNotification(notification); }