mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-27 19:17:47 +01:00
feat: optimize return value in pkg modifier (#17655)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
486bdb6b99
commit
81f618fb9a
@ -42,6 +42,6 @@ func (s *SecretAuthorizer) Modify(req *http.Request) error {
|
||||
if req == nil {
|
||||
return errors.New("the request is null")
|
||||
}
|
||||
err := secret.AddToRequest(req, s.secret)
|
||||
return err
|
||||
|
||||
return secret.AddToRequest(req, s.secret)
|
||||
}
|
||||
|
@ -43,8 +43,7 @@ func InternalEnableVerifyClientCert() bool {
|
||||
func GetInternalCertPair() (tls.Certificate, error) {
|
||||
crtPath := os.Getenv(internalTLSCertPath)
|
||||
keyPath := os.Getenv(internalTLSKeyPath)
|
||||
cert, err := tls.LoadX509KeyPair(crtPath, keyPath)
|
||||
return cert, err
|
||||
return tls.LoadX509KeyPair(crtPath, keyPath)
|
||||
}
|
||||
|
||||
// GetInternalTLSConfig return a tls.Config for internal https communicate
|
||||
|
Loading…
Reference in New Issue
Block a user