Skip to content

Commit

Permalink
Fixed the long accept header limit exceed during sync.
Browse files Browse the repository at this point in the history
  • Loading branch information
ipanova authored and lubosmj committed Jul 9, 2024
1 parent d04d701 commit a81deb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES/1696.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed the long accept header limit exceed during sync.
11 changes: 6 additions & 5 deletions pulp_container/app/downloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

log = getLogger(__name__)

# Usually webservers ignore accept headers for blob endpoint
# However, some webservers when serving blobs need to have explicitly specified octet-stream
# in the accept headers
V2_ACCEPT_HEADERS_OCTET = {"Accept": V2_ACCEPT_HEADERS["Accept"] + ",application/octet-stream"}


class RegistryAuthHttpDownloader(HttpDownloader):
"""
Expand Down Expand Up @@ -50,11 +55,7 @@ async def _run(self, handle_401=True, extra_data=None):
# these accept headers are going to be sent with every request to ensure downloader
# can download manifests, namely in the repair core task
# FIXME this can be rolledback after https://github.com/pulp/pulp_container/issues/1288
headers = V2_ACCEPT_HEADERS
# Usually webservers ignore accept headers for blob endpoint
# However, some webservers when serving blobs need to have explicitly specified octet-stream
# in the accept headers
headers["Accept"] = headers["Accept"] + ",application/octet-stream"
headers = V2_ACCEPT_HEADERS_OCTET
repo_name = None
if extra_data is not None:
headers = extra_data.get("headers", headers)
Expand Down

0 comments on commit a81deb1

Please sign in to comment.