diff --git a/swift.go b/swift.go index cb2b8b1e8..7ad2d5e72 100644 --- a/swift.go +++ b/swift.go @@ -556,10 +556,12 @@ func (c *Connection) getUrlAndAuthToken(ctx context.Context, targetUrlIn string, c.authLock.Lock() defer c.authLock.Unlock() targetUrlOut = targetUrlIn - if !c.authenticated() { - err = c.authenticate(ctx) - if err != nil { - return + if !c.authenticated() || targetUrlIn == ""{ + if !c.authenticated() { + err = c.authenticate(ctx) + if err != nil { + return + } } if OnReAuth != nil { targetUrlOut, err = OnReAuth()