fix: address CodeRabbit review feedback
- Handle Headers instance in TSA request detection (not just plain objects) - Wrap timestampPdf with createCorsAwareFetch for OCSP/cert chain requests - Pass 'success' type to showAlert on successful timestamp - Add TSA URL context to timestamp error messages with cause - Remove redundant Uint8Array wrapping in TimestampNode
This commit is contained in:
@@ -43,9 +43,15 @@ export class TimestampNode extends BaseWorkflowNode {
|
||||
|
||||
return {
|
||||
pdf: await processBatch(pdfInputs, async (input) => {
|
||||
const timestampedBytes = await timestampPdf(input.bytes, tsaUrl);
|
||||
|
||||
const bytes = new Uint8Array(timestampedBytes);
|
||||
let bytes: Uint8Array;
|
||||
try {
|
||||
bytes = await timestampPdf(input.bytes, tsaUrl);
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`Failed to timestamp using TSA ${tsaUrl}: ${err instanceof Error ? err.message : err}`,
|
||||
{ cause: err }
|
||||
);
|
||||
}
|
||||
const document = await PDFDocument.load(bytes);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user