diff --git a/CHANGELOG.md b/CHANGELOG.md index 606355e84589..6c2aa952df04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Workspace] Setup workspace skeleton and implement basic CRUD API ([#5075](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5075)) - [Decouple] Add new cross compatibility check core service which export functionality for plugins to verify if their OpenSearch plugin counterpart is installed on the cluster or has incompatible version to configure the plugin behavior([#4710](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4710)) - [Discover] Display inner properties in the left navigation bar [#5429](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5429) +- [Custom Branding] Relative URL should be allowed for logos ([#5572](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5572)) ### 🐛 Bug Fixes diff --git a/src/core/server/rendering/rendering_service.test.ts b/src/core/server/rendering/rendering_service.test.ts index 56a39915e73c..5fa7d010989e 100644 --- a/src/core/server/rendering/rendering_service.test.ts +++ b/src/core/server/rendering/rendering_service.test.ts @@ -195,6 +195,11 @@ describe('RenderingService', () => { const result = await service.isUrlValid('/', 'config'); expect(result).toEqual(false); }); + + it('checks relative URL returns true', async () => { + const result = await service.isUrlValid('/demo/opensearch_mark_default.png', 'config'); + expect(result).toEqual(true); + }); }); describe('isTitleValid()', () => { diff --git a/src/core/server/rendering/rendering_service.tsx b/src/core/server/rendering/rendering_service.tsx index cc4ead118280..437d8e1e3d46 100644 --- a/src/core/server/rendering/rendering_service.tsx +++ b/src/core/server/rendering/rendering_service.tsx @@ -371,6 +371,9 @@ export class RenderingService { this.logger.get('branding').error(`${configName} config is invalid. Using default branding.`); return false; } + if (url.startsWith('/')) { + return true; + } return await Axios.get(url, { httpsAgent: this.httpsAgent, adapter: 'http',