Skip to content

Commit

Permalink
[#1636] sanitize server semver
Browse files Browse the repository at this point in the history
  • Loading branch information
pzadroga committed Dec 19, 2024
1 parent d088ac3 commit 20653ce
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions webui/src/app/version.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,20 +586,23 @@ export class VersionService {
* @private
*/
private checkStorkServerUpdates(data: AppsVersions): void {
if (!this._storkServerVersion) {
if (!this.sanitizeSemver(this._storkServerVersion)) {
return
}

const serverFeedback = this.getSoftwareVersionFeedback(this._storkServerVersion, 'stork', data)
const updateType = serverFeedback.severity === Severity.error ? 'security update' : 'update'
serverFeedback.messages = [
!!serverFeedback.update
? `Stork server ${updateType} is available (${serverFeedback.update}).`
: `Stork server is up-to-date.`,
]
this._serverUpdateNotification$.next({
available: !!serverFeedback.update,
feedback: serverFeedback,
feedback: {
severity: serverFeedback.severity,
update: serverFeedback.update || '',
messages: [
!!serverFeedback.update
? `Stork server ${updateType} is available (${serverFeedback.update}).`
: `Stork server is up-to-date.`,
],
},
})
this.detectAlertingSeverity(serverFeedback?.severity ?? Severity.success)
}
Expand Down

0 comments on commit 20653ce

Please sign in to comment.