1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-11-25 22:32:52 +02:00

remove 'pr:' prefix from projection key to fit into 32 chars

This commit is contained in:
Patrik J. Braun
2025-09-30 19:39:53 +02:00
parent 7032e239dc
commit a320fb4671
2 changed files with 3 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ export class VersionMWs {
try {
// DB version from the client perspective depends on the projection and if the DB was updated
const version = await ObjectManagers.getInstance().VersionManager.getDataVersion();
const projectionKey = req.session.context?.user?.projectionKey ?? '';
const projectionKey = 'pr:' + (req.session.context?.user?.projectionKey ?? '');
res.header(
CustomHeaders.dataVersion,
version + projectionKey

View File

@@ -11,7 +11,7 @@ const LOG_TAG = '[SessionManager]';
export class SessionManager {
public static readonly NO_PROJECTION_KEY = 'pr:' + crypto.createHash('md5').update('No Key').digest('hex');
public static readonly NO_PROJECTION_KEY = crypto.createHash('md5').update('No Key').digest('hex');
private getQueryForUser(user: ContextUser) {
let blockQuery = user.overrideAllowBlockList ? user.blockQuery : Config.Users.blockQuery;
@@ -55,7 +55,7 @@ export class SessionManager {
public createProjectionKey(q: SearchQueryDTO) {
const canonical = SearchQueryUtils.stringifyForComparison(q);
return 'pr:' + crypto.createHash('md5').update(canonical).digest('hex');
return crypto.createHash('md5').update(canonical).digest('hex');
}
public async buildContext(user: ContextUser): Promise<SessionContext> {