Skip to content

Commit

Permalink
Update http_config.go
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
  • Loading branch information
mmorel-35 committed May 13, 2023
1 parent 4239c3a commit 38506c9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions config/http_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var TLSVersions = map[string]TLSVersion{

func (tv *TLSVersion) UnmarshalYAML(unmarshal func(interface{}) error) error {
var s string
err := unmarshal((*string)(&s))
err := unmarshal(&s)
if err != nil {
return err
}
Expand Down Expand Up @@ -1104,9 +1104,9 @@ func (t *tlsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
}

t.mtx.RLock()
equal := bytes.Equal(caHash[:], t.hashCAData) &&
bytes.Equal(certHash[:], t.hashCertData) &&
bytes.Equal(keyHash[:], t.hashKeyData)
equal := bytes.Equal(caHash, t.hashCAData) &&
bytes.Equal(certHash, t.hashCertData) &&
bytes.Equal(keyHash, t.hashKeyData)
rt := t.rt
t.mtx.RUnlock()
if equal {
Expand All @@ -1129,9 +1129,9 @@ func (t *tlsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {

t.mtx.Lock()
t.rt = rt
t.hashCAData = caHash[:]
t.hashCertData = certHash[:]
t.hashKeyData = keyHash[:]
t.hashCAData = caHash
t.hashCertData = certHash
t.hashKeyData = keyHash
t.mtx.Unlock()

return rt.RoundTrip(req)
Expand Down

0 comments on commit 38506c9

Please sign in to comment.