Maps4HTML / HTML-Map-Element-UseCases-Requirements

Use cases and requirements for Maps on the Web
https://maps4html.org/HTML-Map-Element-UseCases-Requirements/
Other
22 stars 12 forks source link

[bug] Bing API examples are being blocked as HTTP mixed content #126

Closed AmeliaBR closed 4 years ago

AmeliaBR commented 4 years ago

@NickFitz, can you go through your Bing API examples & make sure they're all using HTTPS URLs?

The HTTP URLs are being blocked as mixed content in my browser.

create-map.html:158 Mixed Content: The page at 'https://maps4html.github.io/HTML-Map-Element-UseCases-Requirements/examples/create-map.html' was loaded over HTTPS, but requested an insecure script 'http://www.bing.com/api/maps/mapcontrol?key=AmD9pKWiGBXZ6XrD5jWzzJ5ikdkMiXjhLMbb8_drsxVFiyS_jjqDAbRYtkcaKI7r&callback=initBingMap'. This request has been blocked; the content must be served over HTTPS.

I'm also getting a number of other console errors on the page; I'm not sure if they're related to that script not being loaded, the stack traces are all MapBox scripts. Does Bing wrap around MapBox, or is that a bug in a separate demo?

NickFitz commented 4 years ago

I've just come across this myself, setting up some map layers I've created for the layer-related examples on another repository. I'll fix the Bing URLs and check everything else, and also see about setting up my localhost with HTTPS so I catch any future problems earlier.

Malvoz commented 4 years ago

Additionally, we could include


<!-- Should ideally come after <meta charset="utf-8">, but before all resources -->
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

in all the examples documents, to prevent future broken resources due to http:// links.

FYI I opened https://github.com/w3c/respec/issues/2485 earlier.

AmeliaBR commented 4 years ago

Thanks @NickFitz & @Malvoz for both fixes.