Streamlit cloud hosting inserting HTTPS into image requests

Streamlit Cloud bricks image requests made to HTTP URLs. It seems to swap HTTP for HTTPS into the image. This could be the result of the reverse proxy because I recall seeing something similar with a reverse proxy before. Locally, images appear correctly and the HTTP to HTTPS swap does not occur.

Is there a way around this?

App here: https://etheredge-works-tremap-app-dvtnpo.streamlitapp.com/
Selecting a state will cause the issue to appear under “Pressings”.

Additional info:

  • It’s with passing an HTTP URL to a streamlit image component.
  • HTTPS requests can be seen in the browser dev tools network monitor.

Your app seemst to work for me, it displays a bunch of images under “Pressings”, from addresses like http://sweetgum.nybg.org/images3/724/722/01474164.jpg.

Interesting… Let me see if I can replicate your success.

Good catch! Are you using firefox or chrome or something else? It works on firefox but not on chrome. I’m going to look into it some more.

It appears that google chrome blocks HTTP image content (based on some googling). That could be the core of the issue unless anyone knows a workaround that’s not changing to HTTPS as the site doesn’t support it for the hosted resources.

I think this has been an issue for some time, if I correctly understand your problem.

I can’t currently get your app to work, so I’m not sure what you’re doing with the image links, but presumably you could load them in your python code (eg via requests module) and present the image locally within streamlit (eg using st.image with a file-like object from the previous request).

It is unclear why any image source should not be served over https these days though, I’m afraid to say.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.