Skip to content

Commit

Permalink
validation
Browse files Browse the repository at this point in the history
  • Loading branch information
windoze committed Jan 10, 2024
1 parent 811460d commit 4ffcde8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion websocket-server/src/global_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ impl GlobalState {

pub async fn add_entry(&self, mut msg: ClipboardMessage, store: bool) -> anyhow::Result<()> {
debug!("Publishing message: {:?}", msg);
self.sender.send(msg.clone())?;
if self.validate_message_content(&msg).await.is_err() {
warn!("Ignored invalid clipboard entry.");
return Ok(());
}
self.sender.send(msg.clone())?;
match &msg.entry.content {
ServerClipboardContent::ImageUrl(url) => {
let digest = self.image_digest(url).await?;
Expand Down

0 comments on commit 4ffcde8

Please sign in to comment.