Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cctdaniel committed Jul 4, 2024
1 parent 8467cf2 commit 5ef4ff8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/hermes/client/js/src/examples/HermesClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ const argv = yargs(hideBin(process.argv))
})
.parseSync();

function extractAuthorizationHeadersFromUrl(urlString: string): {
/**
* Extracts the endpoint and basic authorization headers from a given URL string.
*
* @param {string} urlString - The URL string containing the endpoint and optional basic auth credentials.
* @returns {{ endpoint: string; headers: HeadersInit }} An object containing the endpoint URL and headers.
*/
function extractBasicAuthorizationHeadersFromUrl(urlString: string): {
endpoint: string;
headers: HeadersInit;
} {
Expand All @@ -47,7 +53,7 @@ function extractAuthorizationHeadersFromUrl(urlString: string): {
}

async function run() {
const { endpoint, headers } = extractAuthorizationHeadersFromUrl(
const { endpoint, headers } = extractBasicAuthorizationHeadersFromUrl(
argv.endpoint
);
const connection = new HermesClient(endpoint, { headers });
Expand Down

0 comments on commit 5ef4ff8

Please sign in to comment.