Przeglądaj źródła

Use string instead of *string and remove trailing space in JSON tag

Co-authored-by: RPRX <[email protected]>
copilot-swe-agent[bot] 2 tygodni temu
rodzic
commit
7ee4bd4182
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      infra/conf/transport_internet.go

+ 3 - 3
infra/conf/transport_internet.go

@@ -406,7 +406,7 @@ type TLSConfig struct {
 	CipherSuites            string           `json:"cipherSuites"`
 	Fingerprint             string           `json:"fingerprint"`
 	RejectUnknownSNI        bool             `json:"rejectUnknownSni"`
-	PinnedPeerCertSha256    *string          `json:"pinnedPeerCertSha256 "`
+	PinnedPeerCertSha256    string           `json:"pinnedPeerCertSha256"`
 	CurvePreferences        *StringList      `json:"curvePreferences"`
 	MasterKeyLog            string           `json:"masterKeyLog"`
 	ServerNameToVerify      string           `json:"serverNameToVerify"`
@@ -457,10 +457,10 @@ func (c *TLSConfig) Build() (proto.Message, error) {
 	}
 	config.RejectUnknownSni = c.RejectUnknownSNI
 
-	if c.PinnedPeerCertSha256 != nil && *c.PinnedPeerCertSha256 != "" {
+	if c.PinnedPeerCertSha256 != "" {
 		config.PinnedPeerCertSha256 = [][]byte{}
 		// Split by pipe separator
-		hashes := strings.Split(*c.PinnedPeerCertSha256, "|")
+		hashes := strings.Split(c.PinnedPeerCertSha256, "|")
 		for _, v := range hashes {
 			v = strings.TrimSpace(v)
 			if v == "" {