Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload.js doesn't respect domain_name #291

Open
dakejahl opened this issue Aug 27, 2024 · 1 comment
Open

upload.js doesn't respect domain_name #291

dakejahl opened this issue Aug 27, 2024 · 1 comment

Comments

@dakejahl
Copy link

type: 'POST',
url: '/upload',
data: form_data,

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

  • Should we load the config.ini into js so we can simply preface /upload with the domain_name?
  • Can we leverage the python upload.py rather than maintain a js and python upload?
  • Or can this be solved within nginx by remapping request paths?
@bkueng
Copy link
Member

bkueng commented Sep 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants