@e-mc/request 0.12.3 → 0.12.4

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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.12.2/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.12.4/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { IModule, ModuleConstructor } from "./index";
@@ -255,9 +255,9 @@ instance.get("http://hostname/path/config.yml", options).then(data => {
255
255
 
256
256
  ## References
257
257
 
258
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/http.d.ts
259
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/request.d.ts
260
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/settings.d.ts
258
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/http.d.ts
259
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/request.d.ts
260
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/settings.d.ts
261
261
 
262
262
  * https://www.npmjs.com/package/@types/node
263
263
 
@@ -298,6 +298,11 @@ class HttpAdapter {
298
298
  }
299
299
  });
300
300
  }
301
+ if (opts.trailers) {
302
+ this.client.once('trailers', (trailers) => {
303
+ opts.trailers.call(this.client, trailers);
304
+ });
305
+ }
301
306
  this.client.once('end', () => {
302
307
  if (this.closed || this.aborted) {
303
308
  return;
package/index.js CHANGED
@@ -904,7 +904,6 @@ class Request extends module_1 {
904
904
  #ipVersion;
905
905
  #agentTimeout;
906
906
  #headers = null;
907
- #certs = null;
908
907
  #baseUrl = null;
909
908
  #connectDns = Object.create(null);
910
909
  #pendingDns = Object.create(null);
@@ -912,6 +911,7 @@ class Request extends module_1 {
912
911
  #statusOn = null;
913
912
  #headersOn = null;
914
913
  #adapter = HTTP_ADAPTER;
914
+ #certs = null;
915
915
  #downloading = new Set();
916
916
  #hostInfo = {};
917
917
  #session = [Object.create(null)];
@@ -1801,7 +1801,7 @@ class Request extends module_1 {
1801
1801
  format = format.split('/').pop().split('-').pop();
1802
1802
  }
1803
1803
  headers ||= {};
1804
- switch (format = format.trim().toLowerCase()) {
1804
+ switch (format = format.toLowerCase()) {
1805
1805
  case 'yaml':
1806
1806
  headers.accept = 'application/yaml, application/x-yaml, text/yaml, text/x-yaml';
1807
1807
  break;
@@ -2094,6 +2094,7 @@ class Request extends module_1 {
2094
2094
  request.emit('error', err);
2095
2095
  })
2096
2096
  .once('end', () => {
2097
+ request.emit('trailers', response.trailers);
2097
2098
  request.emit('end');
2098
2099
  });
2099
2100
  if (expectContinue) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/request",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
4
4
  "description": "Request constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,11 +20,11 @@
20
20
  "license": "BSD-3-Clause",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/module": "0.12.3",
24
- "@e-mc/types": "0.12.3",
23
+ "@e-mc/module": "0.12.4",
24
+ "@e-mc/types": "0.12.4",
25
25
  "combined-stream": "^1.0.8",
26
26
  "js-yaml": "^4.1.0",
27
- "picomatch": "^4.0.2",
27
+ "picomatch": "^4.0.3",
28
28
  "which": "^4.0.0"
29
29
  }
30
30
  }