mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Previously, you could either add no 'upgrade' event handler, in which case all upgrades were ignored, or add an 'upgrade' handler and all upgrade attempts would effectively succeed and skip normal request handling. This change adds a new shouldUpgradeCallback option to HTTP servers, which receives the request details and returns a boolean that controls whether the request should be upgraded. PR-URL: https://github.com/nodejs/node/pull/59824 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>