summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2024-08-15 21:59:52 -0400
committerpommicket <pommicket@gmail.com>2024-08-15 21:59:52 -0400
commit11093ffda4f36e449f83303ffdebf60e5c058404 (patch)
tree09c00aebf14c27f702a1c71c42fe14e00337a6bd /server
parent5a3a0bb35e55294ab84fd8b759c637a0f1aeea82 (diff)
Fix link to image for non-host
Diffstat (limited to 'server')
-rw-r--r--server/src/main.rs11
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 ") {