Skip to content

Commit

Permalink
Fix logo image cache on upload
Browse files Browse the repository at this point in the history
  • Loading branch information
asteriscos committed Oct 28, 2022
1 parent 88822ca commit ccd57ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ export const PLUGIN_SETTINGS: { [key: string]: TPluginSetting } = {
store: {
relativePathFileSystem: 'public/assets/custom/images',
filename: 'customization.logo.app',
resolveStaticURL: (filename: string) => `custom/images/${filename}`
resolveStaticURL: (filename: string) => `custom/images/${filename}?v=${Date.now()}`
}
}
},
Expand Down Expand Up @@ -984,7 +984,7 @@ export const PLUGIN_SETTINGS: { [key: string]: TPluginSetting } = {
store: {
relativePathFileSystem: 'public/assets/custom/images',
filename: 'customization.logo.healthcheck',
resolveStaticURL: (filename: string) => `custom/images/${filename}`
resolveStaticURL: (filename: string) => `custom/images/${filename}?v=${Date.now()}`
}
}
},
Expand Down Expand Up @@ -1058,7 +1058,7 @@ export const PLUGIN_SETTINGS: { [key: string]: TPluginSetting } = {
store: {
relativePathFileSystem: 'public/assets/custom/images',
filename: 'customization.logo.sidebar',
resolveStaticURL: (filename: string) => `custom/images/${filename}`
resolveStaticURL: (filename: string) => `custom/images/${filename}?v=${Date.now()}`
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions server/controllers/wazuh-utils/wazuh-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class WazuhUtilsCtrl {

/**
* Returns Wazuh app logs
* @param {Object} context
* @param {Object} context
* @param {Object} request
* @param {Object} response
* @returns {Array<String>} app logs or ErrorResponse
Expand Down Expand Up @@ -164,7 +164,7 @@ export class WazuhUtilsCtrl {

// Update the setting in the configuration cache
const pluginSettingValue = pluginSetting.options.file.store.resolveStaticURL(fileNamePath);
await updateConfigurationFile.updateConfiguration({[key]: pluginSettingValue});
await updateConfigurationFile.updateConfiguration({[key]: pluginSettingValue});

return response.ok({
body: {
Expand Down Expand Up @@ -201,7 +201,7 @@ export class WazuhUtilsCtrl {

// Update the setting in the configuration cache
const pluginSettingValue = pluginSetting.defaultValue;
await updateConfigurationFile.updateConfiguration({[key]: pluginSettingValue});
await updateConfigurationFile.updateConfiguration({[key]: pluginSettingValue});

return response.ok({
body: {
Expand All @@ -219,7 +219,7 @@ export class WazuhUtilsCtrl {
},
3023
)

private routeDecoratorProtectedAdministratorRoleValidToken(routeHandler, errorCode: number){
return async (context, request, response) => {
try{
Expand Down

0 comments on commit ccd57ca

Please sign in to comment.