Skip to content

Commit

Permalink
Fix unwrap from HeaderName::from_str call
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervonb committed Jul 17, 2023
1 parent cb0e15a commit 894ddbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion async-nats/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ impl Connection {
value.push_str(v);
}

headers.append(HeaderName::from_str(key).unwrap(), value.trim().to_string());
let name = HeaderName::from_str(key)
.map_err(|err| io::Error::new(io::ErrorKind::InvalidInput, err))?;

headers.append(name, value.trim().to_string());
}

return Ok(Some(ServerOp::Message {
Expand Down

0 comments on commit 894ddbd

Please sign in to comment.