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 f78ab722a8c5..dfd1cb5789ef 100644 --- a/src/core/server/rendering/rendering_service.tsx +++ b/src/core/server/rendering/rendering_service.tsx @@ -171,7 +171,7 @@ export class RenderingService { }; } - public async stop() {} + public async stop() { } /** * Setups HTTP Agent if SSL is enabled to pass SSL config @@ -366,12 +366,15 @@ export class RenderingService { */ public isUrlValid = async (url: string, configName?: string): Promise => { if (url === '/') { - return true; + return false; } if (url.match(/\.(png|svg|gif|PNG|SVG|GIF)$/) === null) { 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: AxiosHttpAdapter,