This commit is contained in:
ManeraKai 2024-08-26 15:30:44 +03:00
parent 9e4c9cda67
commit 8828f1ca97
1 changed files with 7 additions and 4 deletions

View File

@ -24,11 +24,14 @@ function getNextInstance(currentInstanceUrl, instances) {
* @param {URL} url
*/
function protocolHost(url) {
if (url.username && url.password) return `${url.protocol}//${url.username}:${url.password}@${url.host}`
if (url.pathname == "/TekstoLibre/" && url.host.endsWith("github.io"))
url.pathname = url.pathname.replace(/\/$/, '');
if (url.username && url.password) return `${url.protocol}//${url.username}:${url.password}@${url.host}${url.pathname}`
// workaround
if (url.pathname == "/TekstoLibre/" && url.host.endsWith("github.io"))
return `${url.protocol}//${url.host}${url.pathname.slice(0, -1)}`
return `${url.protocol}//${url.host}`
return `${url.protocol}//${url.host}${url.pathname}`
}
/**
@ -221,5 +224,5 @@ export default {
addressToLatLng,
getQuery,
prefsEncoded,
convertMapCentre
convertMapCentre,
}