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

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

commit 3467195b408c3359c28cf83c199951de72662b50
Author: Joe Li <[email protected]>
AuthorDate: Thu Dec 18 22:21:45 2025 -0800

    fix(export): remove double-prefix bug in handleResourceExport
    
    SupersetClient.getUrl() already adds the appRoot prefix when using
    the endpoint parameter. The ensureAppRoot() call was causing URLs
    to be double-prefixed (e.g., /app/prefix/app/prefix/api/v1/...).
    
    Remove the redundant ensureAppRoot() call and clean up the unused
    mock in tests.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
---
 superset-frontend/src/utils/export.test.ts | 4 ----
 superset-frontend/src/utils/export.ts      | 5 +----
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/superset-frontend/src/utils/export.test.ts 
b/superset-frontend/src/utils/export.test.ts
index 88aaa06b39..740c3acb83 100644
--- a/superset-frontend/src/utils/export.test.ts
+++ b/superset-frontend/src/utils/export.test.ts
@@ -33,10 +33,6 @@ jest.mock('@superset-ui/core', () => ({
 
 jest.mock('content-disposition');
 
-jest.mock('./pathUtils', () => ({
-  ensureAppRoot: jest.fn((path: string) => path),
-}));
-
 let mockBlob: Blob;
 let mockResponse: Response;
 let createElementSpy: jest.SpyInstance;
diff --git a/superset-frontend/src/utils/export.ts 
b/superset-frontend/src/utils/export.ts
index 748afd9f1f..6238c419e8 100644
--- a/superset-frontend/src/utils/export.ts
+++ b/superset-frontend/src/utils/export.ts
@@ -19,7 +19,6 @@
 import { SupersetClient, logging } from '@superset-ui/core';
 import rison from 'rison';
 import contentDisposition from 'content-disposition';
-import { ensureAppRoot } from './pathUtils';
 
 // Maximum blob size for in-memory downloads (100MB)
 const MAX_BLOB_SIZE = 100 * 1024 * 1024;
@@ -49,9 +48,7 @@ export default async function handleResourceExport(
   ids: number[],
   done: () => void,
 ): Promise<void> {
-  const endpoint = ensureAppRoot(
-    `/api/v1/${resource}/export/?q=${rison.encode(ids)}`,
-  );
+  const endpoint = `/api/v1/${resource}/export/?q=${rison.encode(ids)}`;
 
   try {
     // Use fetch with blob response instead of iframe to avoid CSP frame-src 
violations

Reply via email to