Skip to content

Commit

Permalink
fix: serverTimeout default to 0 (no timeout) (#5325)
Browse files Browse the repository at this point in the history
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 -->
  • Loading branch information
fengmk2 authored Jun 7, 2024
1 parent 3ddbd06 commit 44ab507
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ module.exports = appInfo => {
config.workerStartTimeout = 10 * 60 * 1000;

/**
* server timeout in milliseconds, default to 2 minutes.
* server timeout in milliseconds, default to 0 (no timeout).
*
* for special request, just use `ctx.req.setTimeout(ms)`
*
Expand Down
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ declare module 'egg' {
* @property {Number} queryString.parameterLimit - parameter number limit, default 1000
* @property {String[]} enableTypes - parser will only parse when request type hits enableTypes, default is ['json', 'form']
* @property {Object} extendTypes - support extend types
* @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.
* @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.
*/
bodyParser: {
enable: boolean;
Expand All @@ -352,7 +352,7 @@ declare module 'egg' {
form: string[];
text: string[];
};
/** Default is `'error'`, it will return `403` response when `Prototype-Poisoning` happen. */
/** Default is `'error'`, it will return `400` response when `Prototype-Poisoning` happen. */
onProtoPoisoning: 'error' | 'remove' | 'ignore';
};

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

/**
* server timeout in milliseconds, default to 2 minutes.
* server timeout in milliseconds, default to 0 (no timeout).
*
* for special request, just use `ctx.req.setTimeout(ms)`
*
Expand Down

0 comments on commit 44ab507

Please sign in to comment.