Skip to content

fix: Refactor HTTP agent cache for better runtime compatibility.#6695

Open
davidkna-sap wants to merge 4 commits into
mainfrom
hash-fallback
Open

fix: Refactor HTTP agent cache for better runtime compatibility.#6695
davidkna-sap wants to merge 4 commits into
mainfrom
hash-fallback

Conversation

@davidkna-sap

@davidkna-sap davidkna-sap commented Jun 23, 2026

Copy link
Copy Markdown
Member

Certain environments with older runtimes (openssl versions) like VSCode may not have blake2s256. I added some fallbacks.

Also get rid of node 20 compatibility handling.

Closes SAP/cloud-sdk-backlog#ISSUENUMBER.

@davidkna-sap davidkna-sap marked this pull request as ready for review June 23, 2026 14:53
Comment thread packages/connectivity/src/scp-cf/cache.ts Outdated
@davidkna-sap davidkna-sap marked this pull request as draft June 25, 2026 07:46
@davidkna-sap davidkna-sap changed the title fix: Add fallbacks if main hash algorithm is not available fix: Refactor HTTP agent cache for better runtime compatibility. Jun 25, 2026
): Promise<string> {
const stringifiedValue = stringify(value);
const encodedValue = new TextEncoder().encode(stringifiedValue);
const hashBuffer = await crypto.subtle.digest('SHA-256', encodedValue);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to this as this is a browser API which includes a non-dynamic list of algorithms that are supported: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest#parameters

@davidkna-sap davidkna-sap marked this pull request as ready for review June 25, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant