using now session cookies to store protectedSessionId

This commit is contained in:
zadam
2019-03-13 21:53:09 +01:00
parent 24c8b39d8e
commit b4c6d9f800
9 changed files with 31 additions and 27 deletions

View File

@@ -3,18 +3,10 @@ import utils from './utils.js';
import infoService from "./info.js";
function getHeaders() {
let protectedSessionId = null;
try { // this is because protected session might not be declared in some cases
protectedSessionId = protectedSessionHolder.getProtectedSessionId();
}
catch(e) {}
// headers need to be lowercase because node.js automatically converts them to lower case
// so hypothetical protectedSessionId becomes protectedsessionid on the backend
// also avoiding using underscores instead of dashes since nginx filters them out by default
return {
'trilium-protected-session-id': protectedSessionId,
'trilium-source-id': glob.sourceId
};
}