Referer

From OpenStreetMap Wiki
Jump to navigation Jump to search

If you have followed a hyperlink or URL to this page, you are using an application or webpage that we have automatically blocked for violating OpenStreetMap's tile usage policy.

If you are a user of the application/website

On a mobile or desktop application, please check if there is a new version of the application that fixes the map. Otherwise, if there are no updates yet, or if you are using a web application or website, please contact its author and let them know about the problem.

If you are the owner/a developer of the application/website

If the block mentions "Referer is required" then please ensure the HTTP Referer header is included with every tile request. For more details, see the MDN article covering this header.

In native application contexts, consult your map provider library's documentation, or set the Referer header yourself on requests you emit.

In web contexts existence of Referer in requests is controlled by the Referrer-Policy header generally, and by Request.referrerPolicy when using the Fetch JavaScript API.

For OpenStreetMap tile usage policy compliance, your Referrer-Policy should

  • Be one of: no-referrer-when-downgrade, origin, origin-when-cross-origin, strict-origin, strict-origin-when-cross-origin
  • Not be one of: no-referrer, same-origin

Library specifics

leaflet

There is a currently open Pull Request at https://github.com/Leaflet/Leaflet/pull/9883 to automatically set the referrer policy to strict-origin-when-cross-origin when using the Foundation's tile servers (tile.openstreetmap.org and tile.osm.org).

django-leaflet

There is a currently open Pull Request at https://github.com/makinacorpus/django-leaflet/pull/405 to automatically set the referrer policy to strict-origin when using the default layer.