I have an application and it is loaded with https, this application loads a map with a KMZ file, and the content of that file has external reference to a PNG image that is loaded with http. This causes the page's https to break.

Look at this example of how this is done.

var kmlUrl = "https://s3.amazonaws.com/geodera-bucket/filesds/5c2e82457cd9e62b0a453ce3-1578081436616-bushfireAlert.kmz";
var kml = new KMLLayer(kmlUrl);
kml.on("load", function() {
  domStyle.set("loading", "display", "none");


I want to replace these http references with https before loading external content.

My application uses AngularJS, JQuery and Dojo, the solution can be with any of these technologies.

  • We're a little different from other sites. We're a Q&A site, not a discussion forum. For questions that involve code we ask that you show us where you are stuck with your own code by including a code snippet in your question. There is an edit button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. Please check out our short tour for more about how the site works. Thanks.
    – PolyGeo
    Commented Jan 10, 2020 at 5:29
  • Cross-posted as stackoverflow.com/questions/59675809/… Commented Jan 22, 2020 at 18:57

1 Answer 1


How about letting the browser do the work by adding this in the :

<meta http-equiv="Content-Security-Policy" 

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests

  • thank you, solve the problem
    – krekto
    Commented Jan 26, 2020 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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