summaryrefslogtreecommitdiff
path: root/std/ws/mod.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/ws/mod.ts')
-rw-r--r--std/ws/mod.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/std/ws/mod.ts b/std/ws/mod.ts
index a32380efc..c256f58ad 100644
--- a/std/ws/mod.ts
+++ b/std/ws/mod.ts
@@ -411,13 +411,13 @@ export function createSecKey(): string {
return btoa(key);
}
-async function handshake(
+export async function handshake(
url: URL,
headers: Headers,
bufReader: BufReader,
bufWriter: BufWriter
): Promise<void> {
- const { hostname, pathname, searchParams } = url;
+ const { hostname, pathname, search } = url;
const key = createSecKey();
if (!headers.has("host")) {
@@ -428,7 +428,7 @@ async function handshake(
headers.set("sec-websocket-key", key);
headers.set("sec-websocket-version", "13");
- let headerStr = `GET ${pathname}?${searchParams || ""} HTTP/1.1\r\n`;
+ let headerStr = `GET ${pathname}${search} HTTP/1.1\r\n`;
for (const [key, value] of headers) {
headerStr += `${key}: ${value}\r\n`;
}