Raruto / leaflet-elevation

Leaflet plugin that allows to add elevation profiles using d3js
GNU General Public License v3.0
254 stars 82 forks source link

controlElevation.load() URL encoding #95

Closed RaunoT closed 3 years ago

RaunoT commented 3 years ago

Hello,

I am facing an issue where using controlElevation.load() doesn't seem to accept UTF-8 URL's.

Example usage:

console.log(gpx)
controlElevation.load(gpx);

The console.log returns ../uploads/Paluküla-1.8km.gpx But it throws a 404 at controlElevation.load() looking for ../uploads/Paluku%CC%88la-1.8km.gpx

As you can see, the URL is not encoded correctly. Any idea for the reasoning?

Raruto commented 3 years ago

Hi Rauno,

I tested a file with the same name and it seems to work fine to me:

XHR GET http://localhost/leaflet-elevation/test/Paluku%CC%88la-1.8km.gpx [HTTP/1.1 200 OK 2ms]

Of course, the file might not really exist on your server...

Otherwise, check carefully your page and headers encodings (try to search on stackoverflow.com for more helpful stuff).

Have a nice day, Raruto

RaunoT commented 3 years ago

You are correct, the problem was in my headers encoding. Sorry for the trobule and thanks again!