mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
fix(cli/websocket): set User-Agent header (#8470)
This commit is contained in:
parent
9042fcc12e
commit
a837fb9a07
1 changed files with 3 additions and 0 deletions
|
@ -99,6 +99,9 @@ pub async fn op_ws_create(
|
||||||
let uri: Uri = args.url.parse()?;
|
let uri: Uri = args.url.parse()?;
|
||||||
let mut request = Request::builder().method(Method::GET).uri(&uri);
|
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() {
|
if !args.protocols.is_empty() {
|
||||||
request = request.header("Sec-WebSocket-Protocol", args.protocols);
|
request = request.header("Sec-WebSocket-Protocol", args.protocols);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue