1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00

fix(cli/websocket): set User-Agent header (#8470)

This commit is contained in:
crowlKats 2020-11-26 13:58:50 +01:00 committed by GitHub
parent 9042fcc12e
commit a837fb9a07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}