Per Malm
Per Malm

Reputation: 81

How to prevent Google Cloud Storage redirect

A file like this one: https://storage.cloud.google.com/gadr_images/avatar/perja.jpg gets redirected, and because android image elements do not work with redirected urls, i want to prevent that. How can that be done?

Upvotes: 3

Views: 1152

Answers (2)

Per Malm
Per Malm

Reputation: 81

Found a solution: If u access a an image or other file via: https://storage.googleapis.com/gadr_images/avatar/perja.jpg instead u w ill not be redirected. I'm not sure if this is an official way to access data, but it works, without redirects.

Upvotes: 5

Stefan Neacsu
Stefan Neacsu

Reputation: 693

A way to do it is to keep the request that the URL gives you with HTTPS so the redirect stays on the same protocol.

If not you can try using Picasso 2 OkHttp 3 Downloader that may fix the problem if the HTTPS redirection on the same protocol does not work.

Upvotes: 1

Related Questions