HTTP mixed content on urls from representative data, how to handle?

Skip to first unread message

jeuel wilkerson

Jun 2, 2018, 4:00:41 PM6/2/18
to Google Civic Information API
I've noticed recently that the URLs returned from endpoints are not HTTPS, but instead are HTTP. 

For example, `<YOUR-KEY-HERE>` would return the representative Nancy Pelosi and the `photoUrl` key would have the value ``.

When trying to use this url, however, in production you'll receive a error saying "requested an insecure image ''. This content should also be served over HTTPS." and some browsers won't show the image.

What is the best way to handle these cases so that you can display the image securely for all major browsers?

Cong Chen

Jun 8, 2018, 10:45:15 AM6/8/18
to Google Civic Information API
Thanks Jeuel.

In this particular case, I'm actually getting a "This site can’t be reached...ERR_CONNECTION_TIMED_OUT" when trying to hit the image via

It sounds like in this case it is an application/browser specific constraints that resulted in such an error (e.g. if we try to embed an https image within a https page, it wouldn't work). What we can do is to ask our data provider to supply both https and http images, but it's going to be best effort given that this is an optional field and that sometimes there may not be any (https/http) images.


You received this message because you are subscribed to the Google Groups "Google Civic Information API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Jared Marcotte

Oct 20, 2020, 4:11:14 PM10/20/20
to Google Civic Information API
Dragging up an old thread for anyone else who may be running into this issue. Thanks to Eric Mill, we found a bit of a workaround for congressional images. For the current bioguide situation, there's another site that is HTTPS (NB: turns out redirects to You can swap the "" part of the URL with "" (e.g. would become Hope this helps!
Reply all
Reply to author
0 new messages