egg 3.24.0 → 3.25.0

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,12 +9,11 @@ English | [简体中文](./README.zh-CN.md)
9
9
  [![NPM download](https://img.shields.io/npm/dm/egg.svg?style=flat-square)](https://npmjs.org/package/egg)
10
10
  [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Feggjs%2Fegg.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Feggjs%2Fegg?ref=badge_shield)
11
11
 
12
- [![Continuous Integration](https://github.com/eggjs/egg/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/egg/actions?query=branch%3Amaster)
12
+ [![Continuous Integration](https://github.com/eggjs/egg/actions/workflows/nodejs-3.x.yml/badge.svg)](https://github.com/eggjs/egg/actions?query=branch%3A3.x)
13
13
  [![Test coverage](https://img.shields.io/codecov/c/github/eggjs/egg.svg?style=flat-square)](https://codecov.io/gh/eggjs/egg)
14
14
  [![Known Vulnerabilities](https://snyk.io/test/npm/egg/badge.svg?style=flat-square)](https://snyk.io/test/npm/egg)
15
15
  [![Open Collective backers and sponsors](https://img.shields.io/opencollective/all/eggjs?style=flat-square)](https://opencollective.com/eggjs)
16
16
 
17
-
18
17
  ## Features
19
18
 
20
19
  - Built-in Process Management
@@ -62,5 +61,4 @@ To become a contributor, please follow our [contributing guide](CONTRIBUTING.md)
62
61
 
63
62
  [MIT](LICENSE)
64
63
 
65
-
66
- [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Feggjs%2Fegg.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Feggjs%2Fegg?ref=badge_large)
64
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Feggjs%2Fegg.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Feggjs%2Fegg?ref=badge_large)
@@ -304,6 +304,7 @@ module.exports = appInfo => {
304
304
  * @property {Number} httpsAgent.maxSockets - https agent max socket number of one host, default is `Number.MAX_SAFE_INTEGER` @ses https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
305
305
  * @property {Number} httpsAgent.maxFreeSockets - https agent max free socket number of one host, default is 256.
306
306
  * @property {Boolean} useHttpClientNext - use urllib@3 HttpClient
307
+ * @property {Boolean} allowH2 - Allow to use HTTP2 first, only work on `useHttpClientNext = true`
307
308
  */
308
309
  config.httpclient = {
309
310
  enableDNSCache: false,
@@ -326,6 +327,7 @@ module.exports = appInfo => {
326
327
  maxFreeSockets: 256,
327
328
  },
328
329
  useHttpClientNext: false,
330
+ // allowH2: false,
329
331
  };
330
332
 
331
333
  /**
@@ -359,7 +361,7 @@ module.exports = appInfo => {
359
361
  config.workerStartTimeout = 10 * 60 * 1000;
360
362
 
361
363
  /**
362
- * server timeout in milliseconds, default to 2 minutes.
364
+ * server timeout in milliseconds, default to 0 (no timeout).
363
365
  *
364
366
  * for special request, just use `ctx.req.setTimeout(ms)`
365
367
  *
package/index.d.ts CHANGED
@@ -296,16 +296,18 @@ declare module 'egg' {
296
296
  request?: HttpClientRequestOptions | RequestOptionsOld;
297
297
  /** Whether enable dns cache */
298
298
  enableDNSCache?: boolean;
299
- /** Enable proxy request, default is false. */
299
+ /** Enable proxy request. Default is `false`. */
300
300
  enableProxy?: boolean;
301
- /** proxy agent uri or options, default is null. */
301
+ /** proxy agent uri or options. Default is `null`. */
302
302
  proxy?: string | { [key: string]: any };
303
303
  /** DNS cache lookup interval */
304
304
  dnsCacheLookupInterval?: number;
305
305
  /** DNS cache max age */
306
306
  dnsCacheMaxLength?: number;
307
- /** use urllib@3 HttpClient */
307
+ /** use urllib@3 HttpClient. Default is `false` */
308
308
  useHttpClientNext?: boolean;
309
+ /** Allow to use HTTP2 first, only work on `useHttpClientNext = true`. Default is `false` */
310
+ allowH2?: boolean;
309
311
  }
310
312
 
311
313
  export interface EggAppConfig {
@@ -330,7 +332,7 @@ declare module 'egg' {
330
332
  * @property {Number} queryString.parameterLimit - parameter number limit, default 1000
331
333
  * @property {String[]} enableTypes - parser will only parse when request type hits enableTypes, default is ['json', 'form']
332
334
  * @property {Object} extendTypes - support extend types
333
- * @property {String} onProtoPoisoning - Defines what action must take when parsing a JSON object with `__proto__`. Possible values are `'error'`, `'remove'` and `'ignore'`. Default is `'error'`, it will return `403` response when `Prototype-Poisoning` happen.
335
+ * @property {String} onProtoPoisoning - Defines what action must take when parsing a JSON object with `__proto__`. Possible values are `'error'`, `'remove'` and `'ignore'`. Default is `'error'`, it will return `400` response when `Prototype-Poisoning` happen.
334
336
  */
335
337
  bodyParser: {
336
338
  enable: boolean;
@@ -352,7 +354,7 @@ declare module 'egg' {
352
354
  form: string[];
353
355
  text: string[];
354
356
  };
355
- /** Default is `'error'`, it will return `403` response when `Prototype-Poisoning` happen. */
357
+ /** Default is `'error'`, it will return `400` response when `Prototype-Poisoning` happen. */
356
358
  onProtoPoisoning: 'error' | 'remove' | 'ignore';
357
359
  };
358
360
 
@@ -532,7 +534,7 @@ declare module 'egg' {
532
534
  onClientError(err: Error, socket: Socket, app: EggApplication): ClientErrorResponse | Promise<ClientErrorResponse>;
533
535
 
534
536
  /**
535
- * server timeout in milliseconds, default to 2 minutes.
537
+ * server timeout in milliseconds, default to 0 (no timeout).
536
538
  *
537
539
  * for special request, just use `ctx.req.setTimeout(ms)`
538
540
  *
@@ -8,6 +8,7 @@ class HttpClientNext extends HttpClient {
8
8
  super({
9
9
  app,
10
10
  defaultArgs: config.request,
11
+ allowH2: config.allowH2,
11
12
  });
12
13
  this.app = app;
13
14
  }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "egg",
3
- "version": "3.24.0",
3
+ "version": "3.25.0",
4
4
  "publishConfig": {
5
- "tag": "latest"
5
+ "tag": "release-3.x",
6
+ "access": "public"
6
7
  },
7
8
  "description": "A web framework's framework for Node.js",
8
9
  "keywords": [
@@ -54,7 +55,7 @@
54
55
  "onelogger": "^1.0.0",
55
56
  "sendmessage": "^2.0.0",
56
57
  "urllib": "^2.33.0",
57
- "urllib-next": "npm:urllib@^3.22.4",
58
+ "urllib-next": "npm:urllib@^3.26.0",
58
59
  "utility": "^2.1.0",
59
60
  "ylru": "^1.3.2"
60
61
  },