PX4 / flight_review

web application for flight log analysis & review
https://logs.px4.io/
BSD 3-Clause "New" or "Revised" License
205 stars 198 forks source link

upload.js doesn't respect domain_name #291

Open dakejahl opened 2 months ago

dakejahl commented 2 months ago

https://github.com/PX4/flight_review/blob/a16c3e7628ce2a57eadc9a49aeba3fa6d7c6e2df/app/plot_app/static/js/upload.js#L100-L102

Problem If the page isn't hosted at the root of the server (behind reverse proxy, say at jetson.local/flight-review) the upload path is incorrect.

Solutions I'm not sure the best way to solve this. I tried using window.location.pathname but this doesn't work if you navigate using the Upload href on the top toolbar, since the path will then be jetson.local/flight-review/upload

Questions

bkueng commented 2 months ago

I would take the path from the configuration. It can be stored in main.js, which goes through the template parsing.