diff --git a/client/src/utils.rs b/client/src/utils.rs index d473cde..d7d836c 100644 --- a/client/src/utils.rs +++ b/client/src/utils.rs @@ -403,7 +403,7 @@ export function define_property(obj, k, v) { export function ws_key() { let key = new Uint8Array(16); crypto.getRandomValues(key); - return btoa(Array.from(key).map(String.fromCharCode).join('')); + return btoa(String.fromCharCode.apply(null, key)); } export function from_entries(entries){ diff --git a/client/src/websocket.rs b/client/src/websocket.rs index af271f4..80a0f66 100644 --- a/client/src/websocket.rs +++ b/client/src/websocket.rs @@ -60,7 +60,7 @@ impl EpoxyWebSocket { .method(Method::GET) .uri(url.clone()) .header(HOST, host) - .header(CONNECTION, "upgrade") + .header(CONNECTION, "Upgrade") .header(UPGRADE, "websocket") .header(SEC_WEBSOCKET_KEY, ws_key()) .header(SEC_WEBSOCKET_VERSION, "13")