mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-26 11:40:26 +00:00
fix: sanitize error message in checkUpdatesNow to avoid exposing paths
Review feedback: strip filesystem paths from error messages and cap length to prevent internal details leaking into the UI.
This commit is contained in:
+3
-1
@@ -2535,7 +2535,9 @@ async function checkUpdatesNow(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(e){
|
} catch(e){
|
||||||
if(status){status.textContent=t('failed_colon')+e.message;status.style.color='var(--error)';}
|
// Sanitize error — avoid exposing internal paths/stack traces
|
||||||
|
const errMsg=(e&&e.message)?e.message.replace(/\/[^\s]*/g,'[path]').substring(0,120):t('settings_up_to_date');
|
||||||
|
if(status){status.textContent=t('failed_colon')+errMsg;status.style.color='var(--error)';}
|
||||||
} finally {
|
} finally {
|
||||||
btn.disabled=false;
|
btn.disabled=false;
|
||||||
if(spinner) spinner.style.display='none';
|
if(spinner) spinner.style.display='none';
|
||||||
|
|||||||
Reference in New Issue
Block a user