Story #8083
Updated by bmbouter almost 4 years ago
## Use Cases 1. For RPM content, oracle linux needs headers sent for the server to respond properly. You can see this work started in these PR: https://github.com/pulp/pulpcore/pull/1041 and https://github.com/pulp/pulp_rpm/pull/1896/ 2. For syncing content using Alternate Content Sources from Pulp instances in EC2, e.g. RHUI servers it also requires headers to be sent with downloads. ## Solution Given that there are two use cases for headers, and headers are a generic HTTP downloading concept, let's add them to [Remote](https://github.com/pulp/pulpcore/blob/05faf9f04c43e20a7d00841d1925c2ef5e0363dc/pulpcore/app/models/repository.py#L180) and have the [DownloaderFactory](https://github.com/pulp/pulpcore/blob/39d395d9751b5eec63069443715d00c64b3cee4e/pulpcore/download/factory.py#L32) DownloadFactory create downloaders with them. These headers are ultimately passed to aiohttp as a dictionary [per their docs](https://docs.aiohttp.org/en/stable/client_advanced.html#custom-request-headers) so let's store the field in DRF as a [DictField](https://www.django-rest-framework.org/api-guide/fields/#dictfield). Probably defined as `DictField(child=CharField())`. That means on `Remote` the new field would be: ``` headers = models.JsonField(null=True) ```