server: better cookie fail-safe (only skip client session path)
This commit is contained in:
parent
a60c1423a7
commit
86abea7a3a
1 changed files with 7 additions and 10 deletions
|
|
@ -45,20 +45,17 @@ resolveDirs.push(settings.read('remote-root') || '') // remote-root / absolute
|
|||
|
||||
function resolvePath(url, clientId) {
|
||||
|
||||
if (clientId === undefined) {
|
||||
var sessionPath
|
||||
|
||||
if (clientId === undefined || !ipc.clients[clientId]) {
|
||||
// safari seems to be picky with cookies
|
||||
console.error(`(ERROR, HTTP) Could not resolve requested url ${url} (client id not found in http cookies)`)
|
||||
return false
|
||||
}
|
||||
|
||||
if (!ipc.clients[clientId]) {
|
||||
if (clientId === undefined) console.error(`(W, HTTP) Could not resolve requested url ${url} (client id not found in http cookies)`)
|
||||
// this should never happen, but just in case...
|
||||
console.error(`(ERROR, HTTP) Could not resolve requested url ${url} (unregistered client id ${clientId})`)
|
||||
return false
|
||||
else console.error(`(ERROR, HTTP) Could not resolve requested url ${url} (unregistered client id ${clientId})`)
|
||||
} else {
|
||||
sessionPath = path.dirname(ipc.clients[clientId].sessionPath)
|
||||
}
|
||||
|
||||
var sessionPath = path.dirname(ipc.clients[clientId].sessionPath)
|
||||
|
||||
url = resolveHomeDir(url)
|
||||
|
||||
for (var i = sessionPath ? -1 : 0; i < resolveDirs.length; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue