Skip to content

fix(res.format): ignore inherited default handler#7333

Open
lin-hongkuan wants to merge 1 commit into
expressjs:masterfrom
lin-hongkuan:codex/express-format-own-default
Open

fix(res.format): ignore inherited default handler#7333
lin-hongkuan wants to merge 1 commit into
expressjs:masterfrom
lin-hongkuan:codex/express-format-own-default

Conversation

@lin-hongkuan

@lin-hongkuan lin-hongkuan commented Jun 24, 2026

Copy link
Copy Markdown

This makes res.format() invoke the default handler only when it is an own property of the formatter object.

The regression test proves inherited default callbacks are ignored and the normal 406 path is preserved.

Validation:

  • npx mocha --require test/support/env --check-leaks test/res.format.js
  • npm run lint
  • git diff --check

AI-assisted: Codex helped prepare this focused change; I reviewed the diff and ran the validation above before submitting.

@krzysdz

krzysdz commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

I have the same question as in #7329 (comment) - why do you think that inherited properties should be ignored?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants