Skip to content

Commit

Permalink
strip relativeUrls from pdf payload
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Aug 13, 2021
1 parent 6c4d699 commit 0007a27
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ export const createJobFnFactory: CreateJobFnFactory<
const crypto = cryptoFactory(config.get('encryptionKey'));

return compatibilityShim(async function createJobFn(
jobParams: JobParamsPDF,
{ relativeUrls, ...jobParams }: JobParamsPDF,
_context: ReportingRequestHandlerContext,
req: KibanaRequest
) {
const serializedEncryptedHeaders = await crypto.encrypt(req.headers);
validateUrls(relativeUrls);

validateUrls(jobParams.relativeUrls);
const serializedEncryptedHeaders = await crypto.encrypt(req.headers);

const payload: TaskPayloadPDF = {
...jobParams,
headers: serializedEncryptedHeaders,
spaceId: reporting.getSpaceId(req, logger),
forceNow: new Date().toISOString(),
objects: jobParams.relativeUrls.map((u) => ({ relativeUrl: u })),
objects: relativeUrls.map((u) => ({ relativeUrl: u })),
};

return payload;
Expand Down

0 comments on commit 0007a27

Please sign in to comment.