mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-29 03:57:56 +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 {
|
if req == nil {
|
||||||
return errors.New("the request is null")
|
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) {
|
func GetInternalCertPair() (tls.Certificate, error) {
|
||||||
crtPath := os.Getenv(internalTLSCertPath)
|
crtPath := os.Getenv(internalTLSCertPath)
|
||||||
keyPath := os.Getenv(internalTLSKeyPath)
|
keyPath := os.Getenv(internalTLSKeyPath)
|
||||||
cert, err := tls.LoadX509KeyPair(crtPath, keyPath)
|
return tls.LoadX509KeyPair(crtPath, keyPath)
|
||||||
return cert, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetInternalTLSConfig return a tls.Config for internal https communicate
|
// GetInternalTLSConfig return a tls.Config for internal https communicate
|
||||||
|
Loading…
Reference in New Issue
Block a user