mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-15 22:01:37 +00:00
Fix: apply base path workerUrls
This commit is contained in:
parent
e39a2bf1a3
commit
9f6d70e130
1 changed files with 4 additions and 1 deletions
|
|
@ -344,8 +344,11 @@ class Server {
|
|||
return
|
||||
}
|
||||
|
||||
const urlKeys = ["href", "src", "url", "scope", "workerUrl"].join("|");
|
||||
const alternateBaseUris = ["http://localhost:3333"].join("|");
|
||||
// Matches e.g `href="/_nuxt/..."` or `src='/...'` or `"url":"http://localhost:3333/...`
|
||||
const replaceUrls = new RegExp(`((?:href|src|url|scope)"?(?:=|:)\\s*["'](?:http://localhost:3333)?)${currentBasePath || "/"}([^"']*["'])`, "g")
|
||||
// $1 = key + assignment operator + opening quote + alternate base, $2 = path + closing quotes
|
||||
const replaceUrls = new RegExp(`((?:${urlKeys})["']?[:=]\\s*["'](?:${alternateBaseUris})?)${currentBasePath || "/"}([^"']*["'])`, "g")
|
||||
const replaceNuxtConfig = new RegExp(`<script>window.__NUXT__=.*?</script>`, "g")
|
||||
const replaceAssetPaths = new RegExp(`${currentBasePath}/(_nuxt/[^"]*|sw.js)`, "g")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue