1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #2111 from jellyfin/dkanada-patch-1

fix possible issue with server detection
This commit is contained in:
dkanada 2020-11-23 20:08:14 +09:00 committed by GitHub
commit f49cb5807a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,9 +31,12 @@ export async function serverAddress() {
const urls = []; const urls = [];
urls.push(window.location.origin); urls.push(window.location.origin);
urls.push(`https://${window.location.hostname}:8920`); urls.push(`https://${window.location.hostname}:8920`);
urls.push(`http://${window.location.hostname}:8096`);
urls.push(...await webSettings.getServers()); urls.push(...await webSettings.getServers());
if (window.location.protocol === 'http') {
urls.push(`http://${window.location.hostname}:8096`);
}
const promises = urls.map(url => { const promises = urls.map(url => {
return fetch(`${url}/System/Info/Public`).then(resp => url).catch(error => { return fetch(`${url}/System/Info/Public`).then(resp => url).catch(error => {
return Promise.resolve(); return Promise.resolve();