From fcd6cac508e29371dd96d9094b0963c659b84a63 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Wed, 7 Jun 2023 19:28:01 +0200 Subject: [PATCH] Removes panic from authShim --- auth.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/auth.go b/auth.go index b57511b..aed8e18 100644 --- a/auth.go +++ b/auth.go @@ -136,7 +136,7 @@ func NewEmptyAuth() Authorizer { // for every request regardless of any `Www-Authenticate` header. // // It may only have one authentication method, -// so calling `AddAuthenticator` will panic! +// so calling `AddAuthenticator` **will panic**! // // Look out!! This offers the skinniest and slickest implementation // without any synchronisation!! @@ -273,9 +273,10 @@ func (s *authShim) Close() error { return nil } -// Do not Clone the shim, it ends badly. In any case for you. +// It's not intend to Clone the shim +// therefore it returns a noAuth instance func (s *authShim) Clone() Authenticator { - panic("Do not Clone the shim, it ends badly. In any case for you.") + return &noAuth{} } // String toString