0

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);
map.addLayer(kml);
kml.on("load", function() {
 domStyle.set("loading", "display", "none");
});

https://codepen.io/krekto/pen/NWPYmRb

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.

asked Jan 10, 2020 at 5:08
2
  • 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. Commented Jan 10, 2020 at 5:29
  • Cross-posted as stackoverflow.com/questions/59675809/… Commented Jan 22, 2020 at 18:57

1 Answer 1

1

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

<meta http-equiv="Content-Security-Policy" 
 content="upgrade-insecure-requests">

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

answered Jan 22, 2020 at 19:49
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.