Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Allow Accept header to send multiple values
Browse files Browse the repository at this point in the history
closes #5211
https://pulp.plan.io/issues/5211

This will allow the Accept header to use multiple values.

I tested this out with pulling directly with docker, which seems to send one value,
and Katello, where we send multiple values. Both scenarios were able to pull successfully.

This will make it easy for Katello to substitute pulp3 registry url instead of crane where it is supported.
  • Loading branch information
John Mitsch committed Aug 6, 2019
1 parent 27e4f04 commit ffd3bec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pulp_docker/app/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ async def get_accepted_media_types(request):
"""
accepted_media_types = []
for header, value in request.raw_headers:
for header, values in request.raw_headers:
if header == b'Accept':
accepted_media_types.append(value.decode('UTF-8'))
values = [v.strip().decode('UTF-8') for v in values.split(b", ")]
accepted_media_types.extend(values)
return accepted_media_types

@staticmethod
Expand Down

0 comments on commit ffd3bec

Please sign in to comment.