diff options
author | pommicket <pommicket@gmail.com> | 2024-08-15 21:59:52 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2024-08-15 21:59:52 -0400 |
commit | 11093ffda4f36e449f83303ffdebf60e5c058404 (patch) | |
tree | 09c00aebf14c27f702a1c71c42fe14e00337a6bd /server | |
parent | 5a3a0bb35e55294ab84fd8b759c637a0f1aeea82 (diff) |
Fix link to image for non-host
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/server/src/main.rs b/server/src/main.rs index 03ae435..c1d0a1d 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -316,7 +316,7 @@ async fn handle_websocket( .ok_or(Error::BadSyntax)? .parse() .map_err(|_| Error::BadSyntax)?; - let url: &str = parts.next().ok_or(Error::BadSyntax)?; + let url: String = parts.next().ok_or(Error::BadSyntax)?.replace(';', " "); if url.len() > 255 { return Err(Error::ImageURLTooLong); } @@ -362,7 +362,7 @@ async fn handle_websocket( id, width, height, - url, + &url, nib_types, piece_positions, connectivity_data, @@ -370,11 +370,8 @@ async fn handle_websocket( .await?; server.player_counts.lock().await.insert(id, 1); *puzzle_id = Some(id); - ws.send(Message::Text(format!( - "id: {}", - std::str::from_utf8(&id)? - ))) - .await?; + ws.send(Message::Text(format!("id: {}", std::str::from_utf8(&id)?))) + .await?; let info = get_puzzle_info(server, &id).await?; ws.send(Message::Binary(info)).await?; } else if let Some(id) = text.strip_prefix("join ") { |