mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-01 16:54:59 +02:00
Remove serverAddress from Feeds and FeedEpisodes URLs
This commit is contained in:
parent
3b4a5b8785
commit
9b8e059efe
10 changed files with 331 additions and 47 deletions
|
@ -253,6 +253,10 @@ class Server {
|
|||
// if RouterBasePath is set, modify all requests to include the base path
|
||||
if (global.RouterBasePath) {
|
||||
app.use((req, res, next) => {
|
||||
const host = req.get('host')
|
||||
const protocol = req.secure || req.get('x-forwarded-proto') === 'https' ? 'https' : 'http'
|
||||
const prefix = req.url.startsWith(global.RouterBasePath) ? global.RouterBasePath : ''
|
||||
req.originalHostPrefix = `${protocol}://${host}${prefix}`
|
||||
if (!req.url.startsWith(global.RouterBasePath)) {
|
||||
req.url = `${global.RouterBasePath}${req.url}`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue