Merge pull request #861 from nxglabs/staging

fix: handle password protected pdf
This commit is contained in:
nxglabs
2025-06-18 14:03:05 +00:00
parent b0e0b38e8f
commit cbca22c308
81 changed files with 4906 additions and 2305 deletions
@@ -53,10 +53,16 @@ const makeEmail = async (
const isSecure =
new URL(url)?.protocol === 'https:' && new URL(url)?.hostname !== 'localhost';
if (isSecure) {
https.get(url, async function (response) {
response.pipe(Pdf);
response.on('end', () => resolve('success'));
});
https
.get(url, async function (response) {
response.pipe(Pdf);
Pdf.on('finish', () => resolve('success'));
Pdf.on('error', () => resolve('error'));
})
.on('error', e => {
console.error(`error: ${e.message}`);
resolve('error');
});
} else {
const httpsAgent = new https.Agent({ rejectUnauthorized: false }); // Disable SSL validation
axios