diff --git a/server/src/rpc.rs b/server/src/rpc.rs index 52ebd51396..1d8de2d9a3 100644 --- a/server/src/rpc.rs +++ b/server/src/rpc.rs @@ -895,10 +895,10 @@ pub fn add_routes(app: &mut tide::Server>, rpc: &Arc) { let upgrade_to_websocket = header_contains_ignore_case(&request, UPGRADE, "websocket"); let upgrade_requested = connection_upgrade && upgrade_to_websocket; let client_protocol_version: Option = request - .header("X-ZRPC-VERSION") + .header("X-Zed-Protocol-Version") .and_then(|v| v.as_str().parse().ok()); - if !upgrade_requested || client_protocol_version != Some(zrpc::VERSION) { + if !upgrade_requested || client_protocol_version != Some(zrpc::PROTOCOL_VERSION) { return Ok(Response::new(StatusCode::UpgradeRequired)); } diff --git a/zed/src/rpc.rs b/zed/src/rpc.rs index 5b18ff310b..86f484607d 100644 --- a/zed/src/rpc.rs +++ b/zed/src/rpc.rs @@ -503,7 +503,7 @@ impl Client { "Authorization", format!("{} {}", credentials.user_id, credentials.access_token), ) - .header("X-ZRPC-VERSION", zrpc::VERSION); + .header("X-Zed-Protocol-Version", zrpc::PROTOCOL_VERSION); cx.background().spawn(async move { if let Some(host) = ZED_SERVER_URL.strip_prefix("https://") { let stream = smol::net::TcpStream::connect(host).await?; diff --git a/zrpc/src/lib.rs b/zrpc/src/lib.rs index 607cd252f0..7e32da83c5 100644 --- a/zrpc/src/lib.rs +++ b/zrpc/src/lib.rs @@ -5,4 +5,4 @@ pub mod proto; pub use conn::Connection; pub use peer::*; -pub const VERSION: u32 = 0; +pub const PROTOCOL_VERSION: u32 = 0;