mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 14:00:01 -04:00
different way of base64ing bytes and match case on connection header
This commit is contained in:
parent
4ab0320c98
commit
d072bc08b4
2 changed files with 2 additions and 2 deletions
|
@ -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){
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue