Leaflet / Leaflet

🍃 JavaScript library for mobile-friendly interactive maps 🇺🇦
https://leafletjs.com
BSD 2-Clause "Simplified" License
41.36k stars 5.83k forks source link

tileLayer http wms over https site forces https request #7337

Closed Diferno closed 3 years ago

Diferno commented 3 years ago

Steps to reproduce Steps to reproduce the behavior:

Expected behavior the wms layer displays correctly

Current behavior the wms url protocol is changed to https because its running under a https site (the wms services doesn't support https) so we get a 404

Environment

Additional context Using vue2-leaflet v2.2.1

IvanSanchez commented 3 years ago

Can't reproduce (firefox 82 or chromium 83 on Linux), see https://plnkr.co/edit/KhJkFZh9ZHNjgFrT

Screenshot_20201115_142731

In any case, Leaflet is not changing the URL scheme of the WMS tiles.

Diferno commented 3 years ago

Hi, sorry to bother, but taking your Plnkr and using the WMS services that generated the issue, the protocol gets changed.... (wtf!)

https://plnkr.co/edit/C3OIwptyhzCQ6h0x

Chrome: image

Firefox: works as intended.... image

Nekzuris commented 2 months ago

I think I encounter the same issue while trying to load this custom layer http://ks3.repetto.org/hillshade_bilinear/{zoom}/{x}/{y}.png in https://www.openstreetmap.org/edit

I've tried multiple browsers without extensions, and even different devices, but the http is always changed to https. Other people have reported that it works fine for them.

Did you found a solution?

Nekzuris commented 2 months ago

Okay, I found the issue, it's the browser settings with mixed content.

Allow it on Firefox in about:config, set security.mixed_content.upgrade_display_content to false Chrome: https://stackoverflow.com/questions/18321032/how-to-get-chrome-to-allow-mixed-content