From c243eb2aca4bad539eb57a24216d1cdbc7be906d Mon Sep 17 00:00:00 2001 From: tarilabs Date: Sat, 6 Jul 2024 22:35:57 +0200 Subject: [PATCH] guard as headers is Optional Signed-off-by: tarilabs --- oras/provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oras/provider.py b/oras/provider.py index 4e45088..6caba9b 100644 --- a/oras/provider.py +++ b/oras/provider.py @@ -928,7 +928,7 @@ def do_request( :type stream: bool """ # Make the request and return to calling function, but attempt to use auth token if previously obtained - if isinstance(self.auth, oras.auth.TokenAuth): + if headers is not None and isinstance(self.auth, oras.auth.TokenAuth): headers.update(self.auth.get_auth_header()) response = self.session.request( method,