fix(buypass): correct Accept header for pem certs

This commit is contained in:
AJ ONeal 2021-06-24 22:07:35 -06:00
parent 45fd6962f2
commit 11732d72b4
2 changed files with 6 additions and 6 deletions

View File

@ -1055,9 +1055,7 @@ ACME._pollOrderStatus = function (me, options, kid, order, verifieds) {
} }
if ('invalid' === resp.body.status) { if ('invalid' === resp.body.status) {
return Promise.reject( return Promise.reject(E.ORDER_INVALID(options, verifieds, resp));
E.ORDER_INVALID(options, verifieds, resp)
);
} }
if ('ready' === resp.body.status) { if ('ready' === resp.body.status) {
@ -1102,7 +1100,7 @@ ACME._redeemCert = function (me, options, kid, voucher) {
url: voucher._certificateUrl, url: voucher._certificateUrl,
protected: { kid: kid }, protected: { kid: kid },
payload: Enc.binToBuf(''), payload: Enc.binToBuf(''),
json: true headers: { Accept: 'application/pem-certificate-chain' }
}).then(function (resp) { }).then(function (resp) {
//#console.debug('ACME.js: csr submitted and cert received:'); //#console.debug('ACME.js: csr submitted and cert received:');

View File

@ -28,7 +28,7 @@ U._jwsRequest = function (me, bigopts) {
.then(function (jws) { .then(function (jws) {
//#console.debug('[ACME.js] url: ' + bigopts.url + ':'); //#console.debug('[ACME.js] url: ' + bigopts.url + ':');
//#console.debug(jws); //#console.debug(jws);
return U._request(me, { url: bigopts.url, json: jws }); return U._request(me, { url: bigopts.url, json: jws, headers: bigopts.headers });
}) })
.catch(function (e) { .catch(function (e) {
if (/badNonce$/.test(e.urn)) { if (/badNonce$/.test(e.urn)) {
@ -84,7 +84,9 @@ U._request = function (me, opts) {
opts.headers['User-Agent'] = ua; opts.headers['User-Agent'] = ua;
} }
if (opts.json) { if (opts.json) {
opts.headers.Accept = 'application/json'; if (!opts.headers.Accept) {
opts.headers.Accept = 'application/json';
}
if (true !== opts.json) { if (true !== opts.json) {
opts.body = JSON.stringify(opts.json); opts.body = JSON.stringify(opts.json);
} }