From a837fb9a0728305a1107c072b3d2aa2480cc512b Mon Sep 17 00:00:00 2001 From: crowlKats <13135287+crowlKats@users.noreply.github.com> Date: Thu, 26 Nov 2020 13:58:50 +0100 Subject: [PATCH] fix(cli/websocket): set User-Agent header (#8470) --- cli/ops/websocket.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/ops/websocket.rs b/cli/ops/websocket.rs index 77b2b5f11d..c8fb895431 100644 --- a/cli/ops/websocket.rs +++ b/cli/ops/websocket.rs @@ -99,6 +99,9 @@ pub async fn op_ws_create( let uri: Uri = args.url.parse()?; let mut request = Request::builder().method(Method::GET).uri(&uri); + request = + request.header("User-Agent", format!("Deno/{}", crate::version::DENO)); + if !args.protocols.is_empty() { request = request.header("Sec-WebSocket-Protocol", args.protocols); }