Skip to content

Commit

Permalink
fix: send proper response in SetTlsConfig (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmichels authored Dec 5, 2024
1 parent 6a25dbd commit e5dc3bc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (c *ADG) GetTlsConfig() (*TlsConfig, error) {
return &tlsConfig, nil
}

// SetAccess - Sets the access list
// SetTlsConfig - Sets the TLS configuration
func (c *ADG) SetTlsConfig(tlsConfig TlsConfig) (*TlsConfig, error) {
// convert provided TLS config to JSON
rb, err := json.Marshal(tlsConfig)
Expand All @@ -51,9 +51,12 @@ func (c *ADG) SetTlsConfig(tlsConfig TlsConfig) (*TlsConfig, error) {
return nil, err
}

// appease Go
_ = body
// convert response to TlsConfig object
var responseTlsConfig TlsConfig
err = json.Unmarshal(body, &responseTlsConfig)
if err != nil {
return nil, err
}

// return the same access list that was passed
return &tlsConfig, nil
return &responseTlsConfig, nil
}

0 comments on commit e5dc3bc

Please sign in to comment.