mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-24 20:54:43 +02:00
Support servers with subdirectory
This commit is contained in:
parent
2452f09714
commit
16de3fdb97
4 changed files with 22 additions and 12 deletions
|
@ -486,9 +486,8 @@ export default {
|
|||
validateServerUrl(url, protocolOverride = null) {
|
||||
try {
|
||||
var urlObject = new URL(url)
|
||||
var address = `${protocolOverride ? protocolOverride : urlObject.protocol}//${urlObject.hostname}`
|
||||
if (urlObject.port) address += ':' + urlObject.port
|
||||
return address
|
||||
if (protocolOverride) urlObject.protocol = protocolOverride
|
||||
return urlObject.href
|
||||
} catch (error) {
|
||||
console.error('Invalid URL', error)
|
||||
return null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue