Skip to content

Commit

Permalink
Added support for subdirectory #875
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Aug 26, 2024
1 parent 9e4c9cd commit 8828f1c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/assets/javascripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
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"))
// workaround
return `${url.protocol}//${url.host}${url.pathname.slice(0, -1)}`
return `${url.protocol}//${url.host}`

return `${url.protocol}//${url.host}${url.pathname}`
}

/**
Expand Down Expand Up @@ -221,5 +224,5 @@ export default {
addressToLatLng,
getQuery,
prefsEncoded,
convertMapCentre
convertMapCentre,
}

0 comments on commit 8828f1c

Please sign in to comment.