Skip to content

Storage: generate_signed_url API documentation misleading for response_type/disposition #7696

@lrowe

Description

@lrowe

Blob.generate_signed_url response_type and response_disposition parameters do not over-ride stored content_type as documented. The signed URL's response-content-type query string parameter is ignored if content-type is set on object metadata.

The generate_signed_url API documentation states (source):

        :type response_disposition: str
        :param response_disposition: (Optional) Content disposition of
                                     responses to requests for the signed URL.
                                     For example, to enable the signed URL
                                     to initiate a file of ``blog.png``, use
                                     the value
                                     ``'attachment; filename=blob.png'``.
        :type response_type: str
        :param response_type: (Optional) Content type of responses to requests
                              for the signed URL. Used to over-ride the content
                              type of the underlying blob/object.

However as documented in Signed URL Considerations:

Query String Parameters like response-content-disposition and response-content-type are not verified by the signature. To force a Content-Disposition or Content-Type in the response, set those parameters in the object metadata.

(Documentation issue confirmed in Google Cloud Support case 19006315.)

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions