Repository navigation
Pin third-party plugin scripts to exact versions - #2362
Open
KhadeerBasha1232 wants to merge 1 commit into
Open
KhadeerBasha1232 wants to merge 1 commit into
KhadeerBasha1232 wants to merge 1 commit into
Conversation
Several plugins loaded JavaScript and CSS from CDN URLs without a fixed version (`@latest`, or jsDelivr/unpkg URLs with no version). The code in every generated map then changes whenever the upstream package or repo changes, including breaking releases or a compromised account. Pin each URL to the version it serves today: - GeoMan: @geoman-io/leaflet-geoman-free 2.20.8 - VectorGridProtobuf: leaflet.vectorgrid 1.3.0 - Geocoder: leaflet-control-geocoder 42.0.0 - TagFilterButton: leaflet-tag-filter-button 0.0.5 - DualMap: Leaflet.Sync 0.2.4 - BeautifyIcon, MousePosition: the current commit of their GitHub repos, which have no tags leaflet.boatmarker was unpublished from npm, so the unpkg URL now returns 404 and BoatMarker fails with "L.boatMarker is not a function". Load it from its GitHub repo instead, at the commit matching npm version 1.1.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KhadeerBasha1232
temporarily deployed
to
pypi
November 19, 2026 17:15 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pin third-party plugin scripts to exact versions
Several plugins load their JavaScript and CSS from CDN URLs without a fixed version:
@latest, or jsDelivr/unpkg URLs with no version at all. The code that runs in a generated map then changes whenever the upstream package or repo changes, without any change in folium. That includes breaking releases, and a compromised package or GitHub account would inject code into every map that uses the plugin.This already happened in two cases:
BoatMarkeris broken.leaflet.boatmarkerwas unpublished from npm on 2026-09-20, sohttps://unpkg.com/leaflet.boatmarker/leaflet.boatmarker.min.jsreturns 404 and the map script fails withTypeError: L.boatMarker is not a function. An unpublished npm name can also be registered again by someone else, and folium would load their package.Geocodersilently moved to a new major version.leaflet-control-geocoderwent from 4.0.0 to 42.0.0 on 2026-11-15, with breaking changes listed in its release notes, and every folium map usingGeocoderpicked it up.Change
Each URL is pinned to the version it serves today, so nothing changes for users:
GeoMan@geoman-io/leaflet-geoman-free2.20.8(was@latest)VectorGridProtobufleaflet.vectorgrid1.3.0(was@latest)Geocoderleaflet-control-geocoder42.0.0TagFilterButtonleaflet-tag-filter-button0.0.5DualMapjieter/Leaflet.Sync0.2.4BeautifyIconmarslan390/BeautifyMarker55e0436(repo has no tags)MousePositionardhi/Leaflet.MousePositionc32f1c8(repo has no tags)BoatMarkerthomasbrueggemann/leaflet.boatmarker1193728, the source of npm 1.1.5, via jsDelivrThe scripts folium hosts itself (
leaflet_heat,pa7_*,leaflet.awesome.rotate) are left as they are, since they come from this repository.Checks
Geocoderwith 42.0.0 and 4.0.0 and saw no visible or functional difference for the way folium uses it.test_beautify_icon.py,test_boat_marker.py,test_dual_map.pyandtest_tag_filter_button.py.