diff --git a/docs/API.md b/docs/API.md index 5fdb5176b..f34b7f74a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -1385,6 +1385,7 @@ __Parameters__ | `object_name` | _str_ | Object name in the bucket. | | `ssec` | _SseCustomerKey_ | Server-side encryption customer key. | | `version_id` | _str_ | Version ID of the object. | +| `extra_headers` | _dict_ | Extra HTTP headers for advanced usage. | | `extra_query_params` | _dict_ | Extra query parameters for advanced usage. | __Return Value__ diff --git a/minio/api.py b/minio/api.py index 836c55cd1..a66df2602 100644 --- a/minio/api.py +++ b/minio/api.py @@ -1854,7 +1854,7 @@ def list_objects(self, bucket_name, prefix=None, recursive=False, ) def stat_object(self, bucket_name, object_name, ssec=None, version_id=None, - extra_query_params=None): + extra_headers=None, extra_query_params=None): """ Get object information and metadata of an object. @@ -1862,6 +1862,7 @@ def stat_object(self, bucket_name, object_name, ssec=None, version_id=None, :param object_name: Object name in the bucket. :param ssec: Server-side encryption customer key. :param version_id: Version ID of the object. + :param extra_headers: Extra HTTP headers for advanced usage. :param extra_query_params: Extra query parameters for advanced usage. :return: :class:`Object `. @@ -1887,6 +1888,9 @@ def stat_object(self, bucket_name, object_name, ssec=None, version_id=None, check_ssec(ssec) headers = ssec.headers() if ssec else {} + if extra_headers: + headers.update(extra_headers) + query_params = extra_query_params or {} query_params.update({"versionId": version_id} if version_id else {}) response = self._execute(