diff --git a/ConnInfo.ts b/ConnInfo.ts index 8df690a..623941c 100644 --- a/ConnInfo.ts +++ b/ConnInfo.ts @@ -3,5 +3,5 @@ export type ConnInfo = Readonly<{ readonly localAddr: Deno.Addr; /** The remote address of the connection. */ readonly remoteAddr: Deno.Addr; - alpnProtocol: string; + alpnProtocol: string | null; }>; diff --git a/on_tcp_connection.ts b/on_tcp_connection.ts index a2cb31f..2afc9e7 100644 --- a/on_tcp_connection.ts +++ b/on_tcp_connection.ts @@ -34,7 +34,7 @@ export async function on_tcp_connection({ // const { alpnProtocol } = hand_shake_info; const conn_info: ConnInfo = { localAddr, - alpnProtocol: "http/1.1", + alpnProtocol: null, remoteAddr, }; const httpConn = Deno.serveHttp(conn); diff --git a/on_tls_connection.ts b/on_tls_connection.ts index ac579be..35e8f3f 100644 --- a/on_tls_connection.ts +++ b/on_tls_connection.ts @@ -31,10 +31,10 @@ export async function on_tls_connection({ const { localAddr, remoteAddr } = conn; const hand_shake_info = await conn.handshake(); - const { alpnProtocol = "http/1.1" } = hand_shake_info; + const { alpnProtocol } = hand_shake_info; const conn_info: ConnInfo = { localAddr, - alpnProtocol: alpnProtocol ?? "http/1.1", + alpnProtocol: alpnProtocol, remoteAddr, }; const httpConn = Deno.serveHttp(conn);