doubly encode the CSR in base64 (#9532)

When the file is provided as an attachment to the Sails helper, it gets
decoded, since we need for the signed CSR to be delivered in base64
format, we doubly encode the contents before sending the email.
This commit is contained in:
Roberto Dip 2023-01-27 15:54:40 -03:00 committed by GitHub
parent 102354be8a
commit 090e9a17c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,7 +139,11 @@ module.exports = {
template: 'email-signed-csr-for-apns',
templateData: {},
attachments: [{
contentBytes: generateCertificateResult.request,
// When the file is provided as an attachment to the Sails helper, it
// gets decoded, since we need for the signed CSR to be delivered in
// base64 format, we doubly encode the contents before sending the
// email.
contentBytes: Buffer.from(generateCertificateResult.request).toString('base64'),
name: 'apple-apns-request.txt',
type: 'text/plain',
}],