diff options
author | crowlKats <13135287+crowlKats@users.noreply.github.com> | 2020-11-26 13:58:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-26 13:58:50 +0100 |
commit | a837fb9a0728305a1107c072b3d2aa2480cc512b (patch) | |
tree | 5d84c17c21f4509e35584e264cca25c2573e1b8a /cli/ops | |
parent | 9042fcc12e7774cdd0ca3a5d08918a07dae8102b (diff) |
fix(cli/websocket): set User-Agent header (#8470)
Diffstat (limited to 'cli/ops')
-rw-r--r-- | cli/ops/websocket.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cli/ops/websocket.rs b/cli/ops/websocket.rs index 77b2b5f11..c8fb89543 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); } |