Skip to content

Commit

Permalink
fix: 403 error details not returned
Browse files Browse the repository at this point in the history
  • Loading branch information
csg01123119 committed Jul 12, 2024
1 parent 0004de9 commit f40ca3d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ const merge = require('merge-descriptors');
const platform = require('platform');
const utility = require('utility');
const urllib = require('urllib');
const {
Base64: { decode: base64ToStr }
} = require('js-base64');
const pkg = require('../package.json');
const bowser = require('bowser');
const signUtils = require('./common/signUtils');
Expand Down Expand Up @@ -381,6 +378,7 @@ proto.requestError = async function requestError(result) {
err.status = result.status;
err.code = info.Code;
err.requestId = info.RequestId;
err.ecCode = info.EC;
err.hostId = info.HostId;
};

Expand Down Expand Up @@ -412,7 +410,7 @@ proto.requestError = async function requestError(result) {
err.status = result.status;
const ossErr = result.headers['x-oss-err'];
if (ossErr) {
const message = base64ToStr(ossErr);
const message = Buffer.from(ossErr, 'base64').toString('utf8');
await setError(message);
}
err.res = result;
Expand Down

0 comments on commit f40ca3d

Please sign in to comment.