Skip to content

Commit 44ab507

Browse files
authored
fix: serverTimeout default to 0 (no timeout) (#5325)
typo fix on onProtoPoisoning, should be 400 response <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Updated the response code for `Prototype-Poisoning` from `403` to `400`. - **Configuration Changes** - Changed the default server timeout setting to 0 (no timeout). <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 3ddbd06 commit 44ab507

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

config/config.default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ module.exports = appInfo => {
359359
config.workerStartTimeout = 10 * 60 * 1000;
360360

361361
/**
362-
* server timeout in milliseconds, default to 2 minutes.
362+
* server timeout in milliseconds, default to 0 (no timeout).
363363
*
364364
* for special request, just use `ctx.req.setTimeout(ms)`
365365
*

index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ declare module 'egg' {
330330
* @property {Number} queryString.parameterLimit - parameter number limit, default 1000
331331
* @property {String[]} enableTypes - parser will only parse when request type hits enableTypes, default is ['json', 'form']
332332
* @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.
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 `400` response when `Prototype-Poisoning` happen.
334334
*/
335335
bodyParser: {
336336
enable: boolean;
@@ -352,7 +352,7 @@ declare module 'egg' {
352352
form: string[];
353353
text: string[];
354354
};
355-
/** Default is `'error'`, it will return `403` response when `Prototype-Poisoning` happen. */
355+
/** Default is `'error'`, it will return `400` response when `Prototype-Poisoning` happen. */
356356
onProtoPoisoning: 'error' | 'remove' | 'ignore';
357357
};
358358

@@ -532,7 +532,7 @@ declare module 'egg' {
532532
onClientError(err: Error, socket: Socket, app: EggApplication): ClientErrorResponse | Promise<ClientErrorResponse>;
533533

534534
/**
535-
* server timeout in milliseconds, default to 2 minutes.
535+
* server timeout in milliseconds, default to 0 (no timeout).
536536
*
537537
* for special request, just use `ctx.req.setTimeout(ms)`
538538
*

0 commit comments

Comments
 (0)