Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

client: Upgrade tiny_http (0.8.2 -> 0.12.0) (#51940)

Tom Houlée5ab982413aa
diff --git a/Cargo.lock b/Cargo.lock
index dcc69ab3711..40bf126b746 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -17716,15 +17716,14 @@ dependencies = [
[[package]]
name = "tiny_http"
-version = "0.8.2"
+version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ce51b50006056f590c9b7c3808c3bd70f0d1101666629713866c227d6e58d39"
+checksum = "389915df6413a2e74fb181895f933386023c71110878cd0825588928e64cdc82"
dependencies = [
"ascii",
- "chrono",
"chunked_transfer",
+ "httpdate",
"log",
- "url",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index a91fbed94ce..af849b4d55a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -717,7 +717,7 @@ time = { version = "0.3", features = [
"formatting",
"local-offset",
] }
-tiny_http = "0.8"
+tiny_http = "0.12"
tokio = { version = "1" }
tokio-socks = { version = "0.5.2", default-features = false, features = [
"futures-io",
diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs
index 45bf43d4e73..f40d90a9839 100644
--- a/crates/client/src/client.rs
+++ b/crates/client/src/client.rs
@@ -1388,7 +1388,11 @@ impl Client {
// Start an HTTP server to receive the redirect from Zed's sign-in page.
let server = tiny_http::Server::http("127.0.0.1:0")
.map_err(|e| anyhow!(e).context("failed to bind callback port"))?;
- let port = server.server_addr().port();
+ let port = server
+ .server_addr()
+ .to_ip()
+ .context("server not bound to a TCP address")?
+ .port();
// Open the Zed sign-in page in the user's browser, with query parameters that indicate
// that the user is signing in from a Zed app running on the same device.