@superhero/http-request 4.0.0 → 4.0.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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/index.js +9 -2
  3. package/package.json +7 -3
package/README.md CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  # HTTP-Request
2
3
 
3
4
  An HTTP client for Node.js supporting HTTP/1.1 and HTTP/2.0, with support for retries, timeouts, and streaming.
package/index.js CHANGED
@@ -326,8 +326,15 @@ export default class Request
326
326
 
327
327
  upstream.on('response', (headers) =>
328
328
  {
329
- upstream.headers = headers
330
- upstream.statusCode = headers[http2.constants.HTTP2_HEADER_STATUS]
329
+ const
330
+ SENSITIVE_HEADERS = http2.sensitiveHeaders,
331
+ HEADER_STATUS = http2.constants.HTTP2_HEADER_STATUS
332
+
333
+ upstream.statusCode = headers[HEADER_STATUS]
334
+ upstream.headers = { ...headers }
335
+
336
+ delete upstream.headers[HEADER_STATUS]
337
+ Object.defineProperty(headers, SENSITIVE_HEADERS, { value:headers[SENSITIVE_HEADERS] })
331
338
 
332
339
  this.#resolveOnResponse(options, method, url, accept, reject, upstream)
333
340
  })
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@superhero/http-request",
3
- "version": "4.0.0",
4
- "description": "HTTP request supporting HTTP 1.1 and HTTP 2.0",
3
+ "version": "4.0.2",
4
+ "description": "HTTP request component supporting HTTP 1.1 and HTTP 2.0",
5
5
  "keywords": [
6
6
  "http request",
7
+ "http client",
8
+ "http2 client",
9
+ "http2",
10
+ "http 2.0",
7
11
  "http 1.1",
8
- "http 2.0"
12
+ "https"
9
13
  ],
10
14
  "main": "index.js",
11
15
  "license": "MIT",