summaryrefslogtreecommitdiff
path: root/ext/websocket/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/websocket/lib.rs')
-rw-r--r--ext/websocket/lib.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs
index d2ec14ec3..2ce141fc9 100644
--- a/ext/websocket/lib.rs
+++ b/ext/websocket/lib.rs
@@ -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(),