Project

Profile

Help

Story #9488

Updated by ipanova@redhat.com over 2 years ago

Azure storage API does not allow to set Content-Type/Content-Disposition headers when redirecting to it. 

 In order to set content settings per-objects basis, docs suggest to subclass the backend and override `AzureStorage.get_object_parameters.` 
 From docs https://django-storages.readthedocs.io/en/latest/backends/azure.html and https://github.com/jschneier/django-storages/blob/master/storages/backends/azure_storage.py#L289 :  
 ``` 
     Use this to set content settings on all objects. To set these on a per-object basis, subclass the backend and override AzureStorage.get_object_parameters. 

     This is a Python dict and the possible parameters are: content_type, content_encoding, content_language, content_disposition, cache_control, and content_md5. 
 ``` 

 Here is WIP PR that needs more work https://github.com/pulp/pulp_container/pull/406#discussion_r719328781 

 **EDIT** This approach is slightly problematic in case artifact is used by multiple content units with different content_types. 

Back