You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ma...@apache.org on 2021/02/01 15:00:07 UTC

[apisix-dashboard] branch master updated: fix: Minor problems left (#1412)

This is an automated email from the ASF dual-hosted git repository.

majunjie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e98820  fix: Minor problems left (#1412)
6e98820 is described below

commit 6e98820e6b5ab60da16e20f0c0fef0e9ba7d1dd0
Author: JinChen <36...@users.noreply.github.com>
AuthorDate: Mon Feb 1 22:59:55 2021 +0800

    fix: Minor problems left (#1412)
---
 api/internal/filter/schema.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/api/internal/filter/schema.go b/api/internal/filter/schema.go
index 120d8bc..9bb6ccc 100644
--- a/api/internal/filter/schema.go
+++ b/api/internal/filter/schema.go
@@ -52,7 +52,7 @@ const (
 
 func parseCert(crt, key string) ([]string, error) {
 	if crt == "" || key == "" {
-		return nil, errors.New("invalid certificate")
+		return nil, errors.New("empty certificate or private key")
 	}
 
 	certDERBlock, _ := pem.Decode([]byte(crt))
@@ -72,7 +72,7 @@ func parseCert(crt, key string) ([]string, error) {
 	}
 
 	//domain
-	snis := []string{}
+	var snis []string
 	if x509Cert.DNSNames != nil && len(x509Cert.DNSNames) > 0 {
 		snis = x509Cert.DNSNames
 	} else if x509Cert.IPAddresses != nil && len(x509Cert.IPAddresses) > 0 {