set_status: reject multi-line and over-200-char text (#720)
This commit is contained in:
parent
26d8565365
commit
6c2cd078f1
4 changed files with 121 additions and 1 deletions
|
|
@ -230,6 +230,12 @@ async fn dispatch(req: &AgentRequest, agent: &str, coord: &Arc<Coordinator>) ->
|
|||
}
|
||||
}
|
||||
AgentRequest::SetStatus { text } => {
|
||||
// #720: cap length + reject multi-line so a confused caller
|
||||
// can't dump a multi-paragraph session report into the
|
||||
// dashboard chip.
|
||||
if let Err(message) = crate::limits::check_status_text(text) {
|
||||
return AgentResponse::Err { message };
|
||||
}
|
||||
let path = crate::coordinator::Coordinator::agent_notes_dir(agent)
|
||||
.join("hyperhive-status");
|
||||
let result = if text.trim().is_empty() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue