Skip to content

Commit

Permalink
Regex support for new format with spaces: " C = GB, ST = England, O =…
Browse files Browse the repository at this point in the history
… Organisation, OU = Provisioning, CN = CommonName, emailAddress = email@address.com"
  • Loading branch information
TomMettam committed Feb 23, 2017
1 parent 4d1f805 commit ca0b353
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pem.js
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,8 @@ function fetchCertificateData(certData, callback) {

function linebrakes(content) {
var helper_x, subject, type;
helper_x = content.replace(/(C|L|O|OU|ST|CN|DC)=/g, '\n$1=');
helper_x = preg_match_all('((C|L|O|OU|ST|CN|DC)=[^\n].*)', helper_x);
helper_x = content.replace(/(C|L|O|OU|ST|CN|DC)\s?=\s?/g, '\n$1=');
helper_x = preg_match_all('((C|L|O|OU|ST|CN|DC)\s?=\s?[^\n].*)', helper_x);
for (var p=0; p<helper_x.length; p++) {
subject = helper_x[p].trim();
type = subject.split('=');
Expand Down

0 comments on commit ca0b353

Please sign in to comment.