Skip to content
Myr

Deprecate string and non-integer arguments to res.status

Before adoption: this commit came in with the history the project adopted, so no landing records it.

closes #4223

authored by Jon Church · committed by Douglas Christopher Wilson · parent c17fe05 · Browse files · 3 files+197 added−12 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+197 added−12 removed

  • tests:+193 added−12 removed
  • other:+4 added−0 removed

3 files+197 added−12 removed

modified:lib/response.js+3 added
62 unmodified lines
63 * @public64 */6566res.status = function status(code) {67 if ((typeof code === 'string' || Math.floor(code) !== code) && code > 99 && code < 1000) {68 deprecate('res.status(' + JSON.stringify(code) + '): use res.status(' + Math.floor(code) + ') instead')69 }70 this.statusCode = code;71 return this;72};73
1084 unmodified lines
modified:test/res.status.js+193 added-12 removed
modified:History.md+1 added
1unreleased2==========34 * Deprecate string and non-integer arguments to `res.status`5 * Ignore `Object.prototype` values in settings through `app.set`/`app.get`6 * Support proper 205 responses using `res.send`784.17.3 / 2022-02-16
3524 unmodified lines