File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -741,10 +741,11 @@ const internalCertificate = {
741
741
*/
742
742
parseX509Output : ( line , prefix ) => {
743
743
// Remove the subject= part
744
- const subject_value = line . slice ( prefix . length ) ;
744
+ const subject_value = line . slice ( prefix . length ) . trim ( ) ;
745
745
746
- const subject = subject_value . split ( / , (? = (?: (?: [ ^ " ] * " ) { 2 } ) * [ ^ " ] * $ ) / )
747
- . map ( ( e ) => { return e . trim ( ) . split ( ' = ' , 2 ) ; } )
746
+ const subject = subject_value . split ( / [ , / ] (? = (?: (?: [ ^ " ] * " ) { 2 } ) * [ ^ " ] * $ ) / )
747
+ . filter ( ( e ) => { return e . length > 0 ; } )
748
+ . map ( ( e ) => { return e . trim ( ) . split ( '=' , 2 ) . map ( ( p ) => { return p . trim ( ) ; } ) ; } )
748
749
. reduce ( ( obj , [ key , value ] ) => {
749
750
obj [ key ] = value . replace ( / ^ " / , '' ) . replace ( / " $ / , '' ) ;
750
751
return obj ;
You can’t perform that action at this time.
0 commit comments