2
votes

I have a .pdf object stored in Google Cloud Storage with Content-Type = application/octet-stream.

When giving temporary access through a signed URL, I extend the URL with:

&response-content-type=application%2Fpdf

Nevertheless, the response coming back from Google Cloud Storage still contains Content-Type = application/octet-stream

Inspecting the request + response through the browser confirms this behaviour.

According to the documentation (https://cloud.google.com/storage/docs/xml-api/reference-headers#responsecontenttype) the response-content-type should ensure Content-Type = application/pdf in my example.

For another usecase, I am succesfully making use of the Content-Disposition override via response-content-disposition, so I am very curious why the response-content-type is not working for me.

Anyone any idea what I am missing to make this work?

Thanks!

1

1 Answers

0
votes

As per documentation signed URLs are not authenticated GET requests that support content-type override.

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 using gsutil or the XML/JSON API.