mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-09-06 17:51:08 +02:00
Fix http/https error
This commit is contained in:
parent
c7c21cc137
commit
50e2fe7fd2
@ -527,7 +527,16 @@ class OidcAuthStrategy {
|
|||||||
|
|
||||||
// For absolute URLs, ensure they point to the same origin
|
// For absolute URLs, ensure they point to the same origin
|
||||||
const callbackUrlObj = new URL(callbackUrl)
|
const callbackUrlObj = new URL(callbackUrl)
|
||||||
const currentProtocol = req.secure || req.get('x-forwarded-proto') === 'https' ? 'https' : 'http'
|
// NPM appends both http and https in x-forwarded-proto sometimes, so we need to check for both
|
||||||
|
const xfp = (req.get('x-forwarded-proto') || '').toLowerCase()
|
||||||
|
const currentProtocol =
|
||||||
|
req.secure ||
|
||||||
|
xfp
|
||||||
|
.split(',')
|
||||||
|
.map((s) => s.trim())
|
||||||
|
.includes('https')
|
||||||
|
? 'https'
|
||||||
|
: 'http'
|
||||||
const currentHost = req.get('host')
|
const currentHost = req.get('host')
|
||||||
|
|
||||||
// Check if protocol and host match exactly
|
// Check if protocol and host match exactly
|
||||||
|
Loading…
Reference in New Issue
Block a user