:lipstick:

Antonio Scandurra and Nathan Sobo created

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

server/src/rpc.rs | 4 ++--
zed/src/rpc.rs    | 2 +-
zrpc/src/lib.rs   | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)

Detailed changes

server/src/rpc.rs 🔗

@@ -895,10 +895,10 @@ pub fn add_routes(app: &mut tide::Server<Arc<AppState>>, rpc: &Arc<Peer>) {
             let upgrade_to_websocket = header_contains_ignore_case(&request, UPGRADE, "websocket");
             let upgrade_requested = connection_upgrade && upgrade_to_websocket;
             let client_protocol_version: Option<u32> = 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));
             }
 

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?;

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;