Opened 95 minutes ago
Last modified 93 minutes ago
#36990 new Bug
Referrer header required for django.contrib.gis.forms.widgets.OSMWidget
| Reported by: | diestl | Owned by: | |
|---|---|---|---|
| Component: | GIS | Version: | 6.0 |
| Severity: | Normal | Keywords: | |
| Cc: | diestl | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The OSMWidget does not set the referrer header (or does not configure open layers to set the referrer header) when making tile requests to the OSM tile server. As per the OSM tile usage policy (https://operations.osmfoundation.org/policies/tiles/), these requests are being blocked.
The OSMWidget is the default widget used in the django admin interface when using the django.contrib.gis.admin.options.GISModelAdmin admin base class for geometry fields such as django.contrib.gis.db.models.PolygonField.
To reproduce this, you need a very simple model:
from django.contrib.gis.db import models class TmpModel(models.Model): geometry = models.PolygonField(geography=True)
and admin:
from .models import TmpModel from django.contrib.gis import admin @admin.register(TmpModel) class DatasetAdmin(admin.GISModelAdmin): pass
Attachments (1)
Change History (2)
comment:1 by , 93 minutes ago
| Cc: | added |
|---|
by , 91 minutes ago
| Attachment: | permission_denied_osm_scaled.png added |
|---|
Screenshot illustrating the issue in the admin interface