Skip to content

Commit

Permalink
Use server basepath when creating reporting jobs (#72722)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
poffdeluxe and elasticmachine authored Jul 22, 2020
1 parent 4dcf719 commit 82dd173
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const scheduleTaskFnFactory: ScheduleTaskFnFactory<ESQueueCreateJobFn<
JobParamsPNG
>> = function createJobFactoryFn(reporting) {
const config = reporting.getConfig();
const setupDeps = reporting.getPluginSetupDeps();
const crypto = cryptoFactory(config.get('encryptionKey'));

return async function scheduleTask(
Expand All @@ -32,7 +31,7 @@ export const scheduleTaskFnFactory: ScheduleTaskFnFactory<ESQueueCreateJobFn<
headers: serializedEncryptedHeaders,
browserTimezone,
layout,
basePath: setupDeps.basePath(req),
basePath: config.kbnConfig.get('server', 'basePath'),
forceNow: new Date().toISOString(),
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const scheduleTaskFnFactory: ScheduleTaskFnFactory<ESQueueCreateJobFn<
JobParamsPDF
>> = function createJobFactoryFn(reporting) {
const config = reporting.getConfig();
const setupDeps = reporting.getPluginSetupDeps();
const crypto = cryptoFactory(config.get('encryptionKey'));

return async function scheduleTaskFn(
Expand All @@ -26,7 +25,7 @@ export const scheduleTaskFnFactory: ScheduleTaskFnFactory<ESQueueCreateJobFn<
validateUrls(relativeUrls);

return {
basePath: setupDeps.basePath(req),
basePath: config.kbnConfig.get('server', 'basePath'),
browserTimezone,
forceNow: new Date().toISOString(),
headers: serializedEncryptedHeaders,
Expand Down

0 comments on commit 82dd173

Please sign in to comment.