2

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?

1
  • "android image elements do not work with redirected urls" - could you edit the question to be more specific about what isn't working the way you expect? What is an "Android image element"? Dec 30, 2019 at 16:32

2 Answers 2

4

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.

1

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.

2
  • thanks, but not sure what u mean with "keep the reqest..". the original url and the redirected one are both https. I am primarily looking for some setting in google storage so that urls do not redirect.
    – Per Malm
    Dec 30, 2019 at 13:59
  • By keep the request I meant that to try to enforce it to stay on HTTPS so it would not change from HTTPS to http which would trigger a redirect. Regarding a setting in Google Storage so the urls do not redirect, there is no setting like this. A thing you can do is to do CNAME Redirects if you have your own domain since this will go through without adding the redirect since it will go through your own domain. Dec 30, 2019 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.