Leaflet tiles referrer problem

I’ve started getting these tile images appear apparently randomly. As you can see it’s not every tile.

I thought this line of code was meant to resolve referrer issues:

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{
	referrerPolicy: 'strict-origin-when-cross-origin'
}).addTo(map); 

Is this a ‘me’ problem or more widespread? Is there a foolproof solution?

See Error 403 when using local files - referer missing - can I use User Agent and what should it contain if it is a local file

See Access blocked on osm.org if you see it on osm.org

If you see it somewhere else it is site in violation of Tile Usage Policy or you use weird browser extensions/weird browser/other weird setup.

for start, it is using wrong url and violates tile usage policy, see Tile Usage Policy

You must:

  • Use the correct URL: https://tile.openstreetmap.org/{z}/{x}/{y}.png.
1 Like

It appears those who wrote the code are as confused by this as the end users.

If

http://{s}.tile.osm.org/{z}/{x}/{y}.png'

" violates tile usage policy," why is still available. Those who made the decision should have shut it down.

  1. because it is not causing severe problems

  2. steps were taken to eliminate bad usage when known, up to sending code corrections

  3. they are busy with shutting down requests violating tile usage policy by not sending referer header

  4. they are not obligated to shut it down, noone ever promised that all succeeding and not blocked HTTP requests are confirmation of Tile USage Policy not being violated