From 770ea3fc5174d20da53d2bed5586348d8e0d6ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Cardelino?= Date: Wed, 11 Nov 2020 15:47:14 -0300 Subject: [PATCH] Fix duplicate cache invalidation token The cache invalidation token was being added twice to deferred JavaScript files. --- dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs | 2 +- dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs b/dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs index 4e87ec418..d5171ec04 100644 --- a/dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs +++ b/dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs @@ -823,7 +823,7 @@ public void AddStyleSheetFile(string styleSheet) public string GetURLBuildNumber(string resourcePath, string urlBuildNumber) { - if (string.IsNullOrEmpty(urlBuildNumber) && !PathUtil.IsAbsoluteUrl(resourcePath)) + if (string.IsNullOrEmpty(urlBuildNumber) && !PathUtil.IsAbsoluteUrl(resourcePath) && !PathUtil.HasUrlQueryString(resourcePath)) { return "?" + GetCacheInvalidationToken(); } diff --git a/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs b/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs index b7e024182..2b6a4a770 100644 --- a/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs +++ b/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs @@ -3520,6 +3520,11 @@ public static bool IsAbsoluteUrl(string url) return Uri.TryCreate(url, UriKind.Absolute, out result) && (result.Scheme == GXUri.UriSchemeHttp || result.Scheme == GXUri.UriSchemeHttps || result.Scheme == GXUri.UriSchemeFtp); } + public static bool HasUrlQueryString(string url) + { + return url.Contains("?"); + } + public static Uri GetBaseUri() { return new Uri(GxContext.StaticPhysicalPath() + Path.DirectorySeparatorChar.ToString());