Skip to content

Commit 9e29e24

Browse files
authored
Merge pull request #192 from Sojamann/initialize-headers
fix: initialize headers variable in do_request
2 parents 0aea4ea + de00bc6 commit 9e29e24

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515

1616
## [0.0.x](https://github.com/oras-project/oras-py/tree/main) (0.0.x)
17+
- initialize headers variable in do_request (0.2.31)
1718
- Make reproducible targz without mimetype (0.2.30)
1819
- don't include Content-Length header in upload_manifest (0.2.29)
1920
- propagate the tls_verify parameter to auth backends (0.2.28)

oras/provider.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,7 @@ def put_upload(
559559
)
560560
return response
561561

562-
def blob_exists(
563-
self, layer: oras.oci.Layer, container: oras.container.Container
564-
) -> bool:
562+
def blob_exists(self, layer: dict, container: oras.container.Container) -> bool:
565563
"""
566564
Check if a layer already exists in the registry.
567565
@@ -983,12 +981,11 @@ def do_request(
983981
:param stream: stream the responses
984982
:type stream: bool
985983
"""
984+
if headers is None:
985+
headers = {}
986+
986987
# Make the request and return to calling function, but attempt to use auth token if previously obtained
987-
if (
988-
headers is not None
989-
and isinstance(self.auth, oras.auth.TokenAuth)
990-
and self.auth.token is not None
991-
):
988+
if isinstance(self.auth, oras.auth.TokenAuth) and self.auth.token is not None:
992989
headers.update(self.auth.get_auth_header())
993990
response = self.session.request(
994991
method,

oras/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__copyright__ = "Copyright The ORAS Authors."
33
__license__ = "Apache-2.0"
44

5-
__version__ = "0.2.30"
5+
__version__ = "0.2.31"
66
AUTHOR = "Vanessa Sochat"
77
EMAIL = "vsoch@users.noreply.github.com"
88
NAME = "oras"

0 commit comments

Comments
 (0)