@superhero/http-request 4.0.1 → 4.0.3

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.
Files changed (2) hide show
  1. package/index.js +3 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -331,10 +331,10 @@ export default class Request
331
331
  HEADER_STATUS = http2.constants.HTTP2_HEADER_STATUS
332
332
 
333
333
  upstream.statusCode = headers[HEADER_STATUS]
334
- upstream.headers = headers
334
+ upstream.headers = { ...headers }
335
335
 
336
336
  delete upstream.headers[HEADER_STATUS]
337
- Object.defineProperty(headers, SENSITIVE_HEADERS, { value:headers[SENSITIVE_HEADERS] })
337
+ Object.defineProperty(upstream.headers, SENSITIVE_HEADERS, { enumerable:false, value:headers[SENSITIVE_HEADERS] })
338
338
 
339
339
  this.#resolveOnResponse(options, method, url, accept, reject, upstream)
340
340
  })
@@ -382,7 +382,7 @@ export default class Request
382
382
  const response =
383
383
  {
384
384
  status : readable.statusCode,
385
- headers : { ...readable.headers }
385
+ headers : readable.headers
386
386
  }
387
387
 
388
388
  if((response.status >= 400 && false === !!options.doNotThrowOnErrorStatus)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superhero/http-request",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "HTTP request component supporting HTTP 1.1 and HTTP 2.0",
5
5
  "keywords": [
6
6
  "http request",