diff --git a/packages/core/client/src/api-client/APIClient.ts b/packages/core/client/src/api-client/APIClient.ts index d97ccc369e..88fb71cbf2 100644 --- a/packages/core/client/src/api-client/APIClient.ts +++ b/packages/core/client/src/api-client/APIClient.ts @@ -93,7 +93,7 @@ export class APIClient extends APIClientSDK { config.headers['X-With-ACL-Meta'] = true; const headers = this.getHeaders(); Object.keys(headers).forEach((key) => { - config.headers[key] = headers[key]; + config.headers[key] = config.headers[key] || headers[key]; }); return config; }); diff --git a/packages/core/client/src/api-client/__tests__/APIClient.test.tsx b/packages/core/client/src/api-client/__tests__/APIClient.test.tsx index 47a3f74379..c67907c224 100644 --- a/packages/core/client/src/api-client/__tests__/APIClient.test.tsx +++ b/packages/core/client/src/api-client/__tests__/APIClient.test.tsx @@ -68,4 +68,25 @@ describe('APIClient', () => { } expect(apiClient.auth.role).toBeFalsy(); }); + + test('should not overwrite headers in request', async () => { + const instance = axios.create(); + const apiClient = new APIClient(instance); + apiClient.app = { + getName: () => 'test', + } as any; + apiClient.auth.authenticator = 'basic'; + try { + await apiClient.request({ + method: 'GET', + url: '/api/test', + headers: { + 'X-Authenticator': 'test', + }, + }); + } catch (err) { + expect(err).toBeDefined(); + expect(err.config.headers['X-Authenticator']).toBe('test'); + } + }); }); diff --git a/scripts/release/changelogAndRelease.js b/scripts/release/changelogAndRelease.js index a33703f1a8..4864bf1555 100644 --- a/scripts/release/changelogAndRelease.js +++ b/scripts/release/changelogAndRelease.js @@ -423,8 +423,8 @@ async function postCMS(tag, content, contentCN) { }, data: { slug: tag, - title: `Nocobase ${tag}`, - title_cn: `Nocobase ${tag}`, + title: `NocoBase ${tag}`, + title_cn: `NocoBase ${tag}`, content, content_cn: contentCN, description: `Release Note of ${tag}`,