Improvements to URL handling in the webapp allowing for SSL (when behind a proxy) #104296

Merged
Sybren A. Stüvel merged 5 commits from william-at-counter/flamenco:main into main 2024-04-11 15:00:55 +02:00
Showing only changes of commit 3b5a1e933a - Show all commits

View File

@ -1,9 +1,9 @@
let url = new URL(window.location.href); let url = new URL(window.location.href);
// Uncomment this when the web interface is running on a different port than the // Uncomment this when the web interface is running on a different port than the
// API, for example when using the Vite devserver. Set the API port here. // API, for example when using the Vite devserver. Set the API port here.
william-at-counter marked this conversation as resolved Outdated

The new comment doesn't explain why this piece of code is there to begin with. Please do keep the explanation that when using Vite in dev mode, the web app runs on a different port than the API.

The new comment doesn't explain why this piece of code is there to begin with. Please do keep the explanation that when using Vite in dev mode, the web app runs on a different port than the API.
if (url.port == '8081') { // if (url.port == '8081') {
url.port = '8080'; // url.port = '8080';
} // }
const URLs = { const URLs = {
api: `${url.protocol}//${url.hostname}:${url.port}/`, api: `${url.protocol}//${url.hostname}:${url.port}/`,