Merge branch 'version-command' of https://tildegit.org/sloum/Bombadillo into version-command

This commit is contained in:
sloum 2020-11-05 19:34:16 -08:00
commit 7219f6cae1
3 changed files with 24 additions and 4 deletions

View File

@ -78,7 +78,7 @@ func (t *TofuDigest) Match(host, localCert string, cState *tls.ConnectionState)
return fmt.Errorf("EXP")
}
if err := cert.VerifyHostname(host); err != nil {
if err := cert.VerifyHostname(host); err != nil && cert.Subject.CommonName != host {
return fmt.Errorf("Certificate error: %s", err)
}
@ -107,7 +107,7 @@ func (t *TofuDigest) newCert(host string, cState *tls.ConnectionState) error {
continue
}
if err := cert.VerifyHostname(host); err != nil {
if err := cert.VerifyHostname(host); err != nil && cert.Subject.CommonName != host {
reasons.WriteString(fmt.Sprintf("Cert [%d] hostname does not match", index+1))
continue
}

View File

@ -97,8 +97,8 @@ func (p *Page) WrapContent(width int, color bool) {
}
continue
}
if ch == '\n' {
content.WriteRune(ch)
if ch == '\n' || ch == '\u0085' || ch == '\u2028' || ch == '\u2029' {
content.WriteRune('\n')
counter = 0
} else if ch == '\t' {
if counter+4 < width {

View File

@ -61,6 +61,26 @@ func Test_WrapContent_Wrapped_Line_Length(t *testing.T) {
false,
},
},
{
"Unicode line endings that should not wrap",
"LF\u000A" +
"CR+LF\u000D\u000A" +
"NEL\u0085" +
"LS\u2028" +
"PS\u2029",
[]string{
"LF",
"CR+LF",
"NEL",
"LS",
"PS",
"",
},
args{
10,
false,
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {