Skip to content

Commit

Permalink
Make sure to strip the scheme from the index URL
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Nov 11, 2024
1 parent eee541f commit bb2f0c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion node/src/handlers/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ const _initializeEnvironment = async function () {
secrets[Name.split("/").reverse()[0]] = JSON.parse(SecretString);
}

putenv("OPENSEARCH_ENDPOINT", secrets.index?.endpoint);
let { endpoint } = secrets.index;
if (URL.canParse(endpoint)) {
endpoint = new URL(endpoint).hostname;
}

putenv("OPENSEARCH_ENDPOINT", endpoint);
putenv("OPENSEARCH_MODEL_ID", secrets.index?.embedding_model);
putenv("NUSSO_API_KEY", secrets.nusso?.api_key);
putenv("NUSSO_BASE_URL", secrets.nusso?.base_url);
Expand Down

0 comments on commit bb2f0c1

Please sign in to comment.