mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 08:33:43 -05:00
fix(ext/websocket): client connect URI (#18892)
This commit is contained in:
parent
142c1ab9fc
commit
8739519ebc
1 changed files with 7 additions and 2 deletions
|
@ -184,7 +184,12 @@ where
|
|||
let root_cert_store = state.borrow().borrow::<WsRootStore>().0.clone();
|
||||
let user_agent = state.borrow().borrow::<WsUserAgent>().0.clone();
|
||||
let uri: Uri = url.parse()?;
|
||||
let mut request = Request::builder().method(Method::GET).uri(&uri);
|
||||
let mut request = Request::builder().method(Method::GET).uri(
|
||||
uri
|
||||
.path_and_query()
|
||||
.ok_or(type_error("Missing path in url".to_string()))?
|
||||
.as_str(),
|
||||
);
|
||||
|
||||
let authority = uri.authority().unwrap().as_str();
|
||||
let host = authority
|
||||
|
@ -195,7 +200,7 @@ where
|
|||
.header("User-Agent", user_agent)
|
||||
.header("Host", host)
|
||||
.header(UPGRADE, "websocket")
|
||||
.header(CONNECTION, "upgrade")
|
||||
.header(CONNECTION, "Upgrade")
|
||||
.header(
|
||||
"Sec-WebSocket-Key",
|
||||
fastwebsockets::handshake::generate_key(),
|
||||
|
|
Loading…
Reference in a new issue