Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
add newline if needed (#1523)
Browse files Browse the repository at this point in the history
Co-authored-by: dhcdn <51758091+davidheerema@users.noreply.github.com>
Co-authored-by: DianeLiu2019 <51336707+DianeLiu2019@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 24, 2020
1 parent 356ec75 commit 5aeada4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions f2/src/utils/encryptedEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ const getCert = uid => {
) {
res.on('searchEntry', function(entry) {
console.log(`Encrypted Mail: Found LDAP entry for ${uid}`)
const cert =
let cert =
'-----BEGIN CERTIFICATE-----\r\n' +
entry.object['userCertificate;binary'].replace(/(.{64})/g, '$1\r\n') +
'-----END CERTIFICATE-----'
entry.object['userCertificate;binary'].replace(/(.{64})/g, '$1\r\n')
if (!cert.endsWith('\n')) cert += '\n'
cert += '-----END CERTIFICATE-----'
fs.writeFile(certFileName(uid), cert, function(err) {
if (err) throw err
else console.log(`Encrypted Mail: Certificate for ${uid} Saved!`)
Expand Down

0 comments on commit 5aeada4

Please sign in to comment.