co-authored by
Nathan Sobo
parent
374b05a379
commit
2352725c58
+2
-2
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user