@jetthai/cuora 1.1.481-api.1 → 1.1.481-api.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.481-api.1",
3
+ "version": "1.1.481-api.2",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -322,8 +322,9 @@ export default class Request {
322
322
  }
323
323
  } catch (error) {
324
324
  if (this._isCancelled(error)) throw this._cancelledError()
325
- if (requestToken && error && typeof error === 'object') {
326
- error.requestToken = requestToken
325
+ // 不可列舉:避免 Bearer token 隨 JSON.stringify/Sentry 序列化外洩,但 error.requestToken 仍可讀取
326
+ if (requestToken && error && typeof error === 'object' && Object.isExtensible(error)) {
327
+ Object.defineProperty(error, 'requestToken', { value: requestToken, enumerable: false, configurable: true })
327
328
  }
328
329
  if (error.code === 'ERR_F108') {
329
330
  this.isBlocked = true