vb64 / django.admin.geomap

Displaying objects on maps in the Django views and administration site.
MIT License
50 stars 9 forks source link

Using files from assets instead of external urls for fixed versions #60

Open rimvislt opened 2 months ago

rimvislt commented 2 months ago

Is it possible to move external files from _https://github.com/vb64/django.admin.geomap/blob/main/django_admin_geomap/templates/geomap/osm/base.html_

<!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/css/ol.css" type="text/css" />
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/build/ol.js"></script>

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js"></script>

to assets, because it is fixed versions and it is blocked by "Content-Security-Policy" by default.

This requires to add exemptions for fixed versions URLs on all servers.

vb64 commented 2 months ago

Of course, it is possible.

But we need to figure out the best way to do it in order to maintain backward compatibility with existing installations.

Do you have any suggestions?