Skip to content

Commit

Permalink
base-acme-client.js
Browse files Browse the repository at this point in the history
silence postAsGet
silence postAsGetChal
fetchAndRetryProtectedUntilOk can be silenced now

remove answer wrapper
simplify entire API to get or error

eg.
order.get | order.error
account.get | account.error
directory.get | directory.error
  • Loading branch information
FirstTimeEZ committed Dec 18, 2024
1 parent fc32537 commit 9ef7fc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base-acme-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export async function postAsGet(kid, nonce, privateKey, url, acmeDirectory) {
url: url,
};

const response = await fetchAndRetryProtectedUntilOk(METHOD_POST_AS_GET, protectedHeader, privateKey, acmeDirectory);
const response = await fetchAndRetryProtectedUntilOk(METHOD_POST_AS_GET, protectedHeader, privateKey, acmeDirectory, 3, true);

if (response) {
return returnAnswer(response, acmeDirectory);
Expand Down Expand Up @@ -279,7 +279,7 @@ export async function postAsGetChal(kid, nonce, privateKey, url, acmeDirectory)
url: url,
};

const response = await fetchAndRetryProtectedUntilOk(METHOD_POST_AS_GET_CHALLENGE, protectedHeader, privateKey, acmeDirectory);
const response = await fetchAndRetryProtectedUntilOk(METHOD_POST_AS_GET_CHALLENGE, protectedHeader, privateKey, acmeDirectory, 3, true);

if (response) {
return returnAnswer(response, acmeDirectory);
Expand Down

0 comments on commit 9ef7fc5

Please sign in to comment.