protomaps / protomaps-leaflet

Lightweight vector map rendering + labeling and symbology for Leaflet
https://protomaps.com/docs/frontends/leaflet
BSD 3-Clause "New" or "Revised" License
767 stars 43 forks source link

Version 3.1.1 Stops sending range header #152

Closed aswarcewicz closed 6 months ago

aswarcewicz commented 6 months ago

I don't know exactly why, but I see that range header was present in requests in version 3.1.0 but after update to 3.1.1 this header has gone

bdon commented 6 months ago

What is the full URL you are requesting with any query parameters?

The logic changed for how it automatically detects if it should treat a string as a PMTiles or a ZXY url.

It used to be checking for ending with .pmtiles, but now it strips off params like foo.pmtiles?abc=123

aswarcewicz commented 6 months ago

Just GET on /api/map-tiles/map.pmtiles Without query params

bdon commented 6 months ago

Does your URL start with http: or https:?

aswarcewicz commented 6 months ago

Https (TLS secured)

bdon commented 6 months ago

Can you create a minimal reproduction page?

wginsberg commented 6 months ago

Sorry I don't have a minimal reproduction but just a +1 that I am experiencing this as well. With 3.1.1 the requests don't have a range header and try to fetch the entire file 😅 . It is working perfectly fine on 3.1.0 though.

bdon commented 6 months ago

What is your complete, exact URL you are fetching from?

wginsberg commented 6 months ago

I'm fetching from https://pub-5ba95de8cc2f4dada22bfe563b284734.r2.dev/20230918-z12.pmtiles Not sure if it matters either way but I am proxying the request through localhost in development

bdon commented 6 months ago

Yes, how are you specifying the URL passed to leafletLayer? Because the form of that string needs to be checked to determine whether it's a ZXY URL or a .pmtiles URL.

wginsberg commented 6 months ago

The URL being passed to leaflet layer was /proxy/20230918-z12.pmtiles. I'm seeing now that http://localhost:3000/proxy/20230918-z12.pmtiles does work 🎊

bdon commented 6 months ago

It should be fixed in v3.1.2, can you please check?

wginsberg commented 6 months ago

@bdon looks like both work with 3.1.2 👍

bdon commented 6 months ago

Thanks for checking, closing!