diff --git a/Cargo.lock b/Cargo.lock index f758163..974c2a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2868,7 +2868,7 @@ dependencies = [ [[package]] name = "pyth-stream" -version = "0.1.7" +version = "0.1.8" dependencies = [ "anyhow", "async-nats", diff --git a/Cargo.toml b/Cargo.toml index ca364a4..584d9a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyth-stream" -version = "0.1.7" +version = "0.1.8" edition = "2021" [lib] diff --git a/src/bin/websocket_server.rs b/src/bin/websocket_server.rs index 82f66d5..244b492 100644 --- a/src/bin/websocket_server.rs +++ b/src/bin/websocket_server.rs @@ -217,7 +217,10 @@ async fn handle_client_message(addr: &str, text: &str, clients: &Clients) -> Res async fn handle_subscribe(addr: &str, ids: Vec, clients: &Clients) -> ServerResponse { let mut clients = clients.lock().await; if let Some((subscriptions, _)) = clients.get_mut(addr) { - for hex_id in ids { + for mut hex_id in ids { + if !hex_id.starts_with("0x") { + hex_id = format!("0x{}", hex_id); + } subscriptions.insert(hex_id.clone()); debug!("Client {} subscribed to feed ID: {}", addr, hex_id); }