Skip to content

Commit

Permalink
BREAKING CHANGE: rename TLS APIs to camel case (denoland/deno#4888)
Browse files Browse the repository at this point in the history
This commit renames all APIs containing "TLS" to use camel case
(connectTLS -> connectTls, etc.)
  • Loading branch information
bartlomieju authored and caspervonb committed Jan 31, 2021
1 parent 78370cd commit 2452304
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions http/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import Listener = Deno.Listener;
import Conn = Deno.Conn;
import Reader = Deno.Reader;
const { listen, listenTLS } = Deno;
const { listen, listenTls } = Deno;

export class ServerRequest {
url!: string;
Expand Down Expand Up @@ -286,7 +286,7 @@ export async function listenAndServe(
}

/** Options for creating an HTTPS server. */
export type HTTPSOptions = Omit<Deno.ListenTLSOptions, "transport">;
export type HTTPSOptions = Omit<Deno.ListenTlsOptions, "transport">;

/**
* Create an HTTPS server with given options
Expand All @@ -306,11 +306,11 @@ export type HTTPSOptions = Omit<Deno.ListenTLSOptions, "transport">;
* @return Async iterable server instance for incoming requests
*/
export function serveTLS(options: HTTPSOptions): Server {
const tlsOptions: Deno.ListenTLSOptions = {
const tlsOptions: Deno.ListenTlsOptions = {
...options,
transport: "tcp",
};
const listener = listenTLS(tlsOptions);
const listener = listenTls(tlsOptions);
return new Server(listener);
}

Expand Down
2 changes: 1 addition & 1 deletion http/server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ test({
"server must be started"
);
// Requests to the server and immediately closes the connection
const conn = await Deno.connectTLS({
const conn = await Deno.connectTls({
hostname: "localhost",
port: 4503,
certFile: "http/testdata/tls/RootCA.pem",
Expand Down
2 changes: 1 addition & 1 deletion ws/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ export async function connectWebSocket(
conn = await Deno.connect({ hostname, port });
} else if (url.protocol === "https:" || url.protocol === "wss:") {
const port = parseInt(url.port || "443");
conn = await Deno.connectTLS({ hostname, port });
conn = await Deno.connectTls({ hostname, port });
} else {
throw new Error("ws: unsupported protocol: " + url.protocol);
}
Expand Down

0 comments on commit 2452304

Please sign in to comment.