Skip to content

Commit

Permalink
alpnProtocol null
Browse files Browse the repository at this point in the history
  • Loading branch information
masx200 committed Jul 6, 2022
1 parent 387044d commit 7cbd09c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ConnInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}>;
2 changes: 1 addition & 1 deletion on_tcp_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions on_tls_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7cbd09c

Please sign in to comment.