mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	s3: Stop setting empty Content-Disposition header.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							54be4443ae
						
					
				
				
					commit
					6258817bfd
				
			@@ -81,18 +81,18 @@ def upload_image_to_s3(
 | 
			
		||||
        "realm_id": str(user_profile.realm_id),
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    content_disposition = ""
 | 
			
		||||
    extras = {}
 | 
			
		||||
    if content_type is None:
 | 
			
		||||
        content_type = ""
 | 
			
		||||
    if content_type not in INLINE_MIME_TYPES:
 | 
			
		||||
        content_disposition = "attachment"
 | 
			
		||||
        extras["ContentDisposition"] = "attachment"
 | 
			
		||||
 | 
			
		||||
    key.put(
 | 
			
		||||
        Body=contents,
 | 
			
		||||
        Metadata=metadata,
 | 
			
		||||
        ContentType=content_type,
 | 
			
		||||
        ContentDisposition=content_disposition,
 | 
			
		||||
        StorageClass=storage_class,
 | 
			
		||||
        **extras,  # type: ignore[arg-type] # The dynamic kwargs here confuse mypy.
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user