This is an automated email from the ASF dual-hosted git repository.

jli pushed a commit to branch fix-app-root-logos
in repository https://gitbox.apache.org/repos/asf/superset.git

commit cdee48767494a44c6809801199e38f296449dcbd
Author: Joe Li <[email protected]>
AuthorDate: Sun Mar 1 19:15:38 2026 -0800

    fix(frontend): preserve absolute and protocol-relative URLs in ensureAppRoot
    
    ensureAppRoot() previously prepended the application root to all inputs,
    breaking navigation when LOGO_TARGET_PATH is an absolute URL — the result
    was a double-prefixed URL like
    https://<workspace>/https://manage.app.preset.io.
    
    URLs with a URI scheme (https://, http://, ftp://, mailto:, etc.) and
    protocol-relative URLs (//example.com) are now returned unchanged. Relative
    paths continue to receive the application root prefix as before.
    
    Fixes absolute brandLogoHref navigation broken by apache/superset#36058.
    
    Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
---
 superset-frontend/src/utils/pathUtils.ts | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/utils/pathUtils.ts 
b/superset-frontend/src/utils/pathUtils.ts
index 0e6cac429f..a330d81d38 100644
--- a/superset-frontend/src/utils/pathUtils.ts
+++ b/superset-frontend/src/utils/pathUtils.ts
@@ -21,9 +21,17 @@ import { applicationRoot } from 'src/utils/getBootstrapData';
 /**
  * Takes a string path to a resource and prefixes it with the application root 
that is
  * defined in the application configuration. The application path is sanitized.
- * @param path A string path to a resource
+ *
+ * Absolute URLs (e.g. https://..., ftp://..., mailto:...) and 
protocol-relative
+ * URLs (e.g. //example.com) are returned unchanged — only relative paths 
receive
+ * the application root prefix.
+ *
+ * @param path A string path or URL to a resource
  */
 export function ensureAppRoot(path: string): string {
+  if (/^[a-zA-Z][a-zA-Z0-9+\-.]*:/.test(path) || path.startsWith('//')) {
+    return path;
+  }
   return `${applicationRoot()}${path.startsWith('/') ? path : `/${path}`}`;
 }
 

Reply via email to