mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
New agents, fixed cert loading with text prefix.
This commit is contained in:
parent
b514efaaf1
commit
e7c3c2cd70
23 changed files with 29 additions and 10 deletions
|
@ -148,6 +148,9 @@ module.exports.CertificateOperations = function () {
|
|||
|
||||
// Make sure a string with Mac style CR endo of line is changed to Linux LF style.
|
||||
function fixEndOfLines(str) {
|
||||
if (typeof (str) != 'string') return str; // If this is not a string, do nothing.
|
||||
var i = str.indexOf('-----'); // Remove everything before "-----".
|
||||
if (i > 0) { str = str.substring(i); } // this solves problems with editors that save text file type indicators ahead of the text.
|
||||
if ((typeof(str) != 'string') || (str.indexOf('\n') > 0)) return str; // If there is a \n in the file, keep the file as-is.
|
||||
return str.split('\r').join('\n'); // If there is no \n, replace all \r with \n.
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue