Commit Graph
188 Commits
Author SHA1 Message Date
Marcos MolinaandGitHub 5bf5075b60 docs: fix JSDoc for req.accepts() return value and parameter format (#6936)
* fixed request accept jsdoc

* reverted format

* reverted format

* updated jsdoc

* updated the rest of the documentation
2026-01-16 16:19:39 -05:00
7b6414ef59 fix: enhance req.acceptsCharsets method (#6088)
* fix: enhance req.acceptsCharsets method

* Update req.acceptsCharsets.js

---------

Co-authored-by: Monaam Aouini <[email protected]>
Co-authored-by: Sebastian Beltran <[email protected]>
2026-01-07 09:41:34 -05:00
Sebastian BeltranandGitHub 7865a30bba lib: use req.socket over deprecated req.connection (#6705)
Signed-off-by: Sebastian Beltran <[email protected]>
2025-08-21 10:05:29 -05:00
Ayoub MabroukandGitHub 172b4e640d Refactor: simplify acceptsLanguages implementation using spread operator (#6137)
Refactored `req.acceptsLanguages` to use the spread operator for passing arguments directly to `accept.languages`, eliminating the need for `.apply`. This approach improves readability and streamlines the function call.
2025-04-10 20:49:23 -05:00
Szymon ŁągiewkaandWes Todd 4199d3218f fix(refactor): prefix built-in node module imports
Since v5 relies on node >= 18, this is now possible (since v16, v14.18.0
[^1][^2]).

It's functionally irrelevant:
1. It's not required for CJS nor ESM (with a few exceptions [^3])
2. It has no performance promises

However, there are upsides to this approach:
1. It brings clear boundaries to what's a built-in and what's an
external dependency
2. It reduces the risk of importing unwanted deps where a built-in is
expected
3. It's slightly more interoperable with other JS runtimes that provide
node compatibility[^4], albeit only during development. Once imported
from npm, built-ins are assumed.

[^1]:https://nodejs.org/docs/latest-v22.x/api/modules.html#built-in-modules
[^2]:https://github.com/nodejs/node/pull/37246
[^3]:https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
[^4]:https://docs.deno.com/runtime/fundamentals/node/#using-node's-built-in-modules
2025-01-10 11:53:44 -06:00
Jon ChurchandGitHub 3682d43c00 update to [email protected] (#5916)
fixes handling of If-Modified-Since in combination with If-None-Match
2024-09-09 17:03:32 -05:00
Douglas Christopher Wilson c7d528cdc0 Merge tag '4.17.2' 2021-12-16 23:01:28 -05:00
Florian BrandtandDouglas Christopher Wilson 353348a83e Fix typo in res.is JSDoc
closes #4192
2021-11-16 00:25:10 -05:00
Douglas Christopher Wilson 121fe9982b Merge tag '4.17.1' 2019-06-08 19:43:21 -04:00
Horatiu Eugen VladandDouglas Christopher Wilson b93ffd4bdc Support multiple hosts in X-Forwarded-Host
fixes #3494
closes #3495
2018-10-28 15:58:25 -04:00
Douglas Christopher Wilson 62e12fe710 Merge tag '4.16.2' 2017-10-13 22:27:30 -04:00
Douglas Christopher Wilson b97faff6e2 perf: skip parsing of entire "X-Forwarded-Proto" header 2017-10-09 22:43:23 -04:00
Douglas Christopher Wilson 501e24e0a9 Merge tag '4.15.0' 2017-03-01 18:17:04 -05:00
Douglas Christopher Wilson 12ff56e1e4 Use Object.create to setup request & response prototypes 2017-02-23 01:52:49 -05:00
Douglas Christopher Wilson f87abb3493 Remove usage of res._headers private field
closes #3174
2017-02-20 22:08:33 -05:00
Ángel SanzandDouglas Christopher Wilson 485b6f86ac perf: improve req.ips performance
closes #2723
2017-02-20 21:24:54 -05:00
Takuma HanataniandDouglas Christopher Wilson 94377f681d lint: remove unnecessary semicolon
closes #3191
2017-02-04 20:43:50 -05:00
Douglas Christopher Wilson 1dbfee6623 Merge tag '4.14.0' 2016-06-20 00:37:34 -04:00
Douglas Christopher Wilson c762b16f62 Improve error with invalid arguments to req.get()
fixes #2993
2016-06-03 00:07:34 -04:00
Douglas Christopher Wilson 5d642af8c3 Add "options" argument to req.range 2016-06-01 19:13:36 -04:00
Douglas Christopher Wilson 7fcf1d7d5b docs: update the req.range jsdoc comment 2016-06-01 19:04:02 -04:00
Ángel SanzandDouglas Christopher Wilson b69b7605b0 perf: use strict equality when possible
closes #2722
2016-05-31 00:25:34 -04:00
Douglas Christopher Wilson 21d52daafb Remove req.param() 2015-07-06 21:15:16 -04:00
Douglas Christopher Wilson b309b873f1 Merge tag '4.13.1' 2015-07-06 16:13:54 -04:00
Douglas Christopher Wilson d414a2dc73 perf: remove argument reassignments in request prototype 2015-06-20 13:48:58 -04:00
Douglas Christopher Wilson e71014f522 perf: enable strict mode 2015-06-18 23:01:18 -04:00
Douglas Christopher Wilson 95ad276cad docs: add license comments 2015-06-18 23:00:20 -04:00
Alexander MareninandDouglas Christopher Wilson fce3d14b5c docs: update return types for req.accept*()
closes #2663
2015-06-18 22:05:57 -04:00
Douglas Christopher Wilson f90e045334 Merge tag '4.12.4' 2015-05-18 00:41:42 -04:00
Douglas Christopher Wilson cd6df7699d Merge tag '3.20.1' 2015-02-28 23:29:23 -05:00
Douglas Christopher Wilson 2e0f5e7817 Fix req.host when using "trust proxy" hops count 2015-02-28 21:32:51 -05:00
Paul SerbyandDouglas Christopher Wilson 20aa12616a Fix req.protocol/req.secure when using "trust proxy" hops count
fixes #2569
closes #2570
2015-02-28 21:29:43 -05:00
Douglas Christopher Wilson f6ec710534 Merge tag '4.12.0' 2015-02-23 01:00:12 -05:00
Elvin YungandDouglas Christopher Wilson 9adfc2d586 Fix typos in req.accepts jsdoc
closes #2527
2015-02-18 22:59:49 -05:00
Douglas Christopher Wilson 8a5ecd3d89 Merge tag '4.11.1' 2015-01-21 03:58:41 -05:00
Douglas Christopher Wilson 4db51fbeba Deprecate req.param()
closes #2440
2015-01-13 19:17:33 -05:00
Douglas Christopher Wilson 4aa2801054 Merge tag '3.18.6' 2014-12-12 22:06:21 -05:00
Troy GoodeandDouglas Christopher Wilson 5d74a553d6 Fix exception in req.fresh/req.stale without response headers
fixes #2468
2014-12-12 21:17:23 -05:00
Douglas Christopher Wilson ccdbe4ea37 Remove req.acceptsLanguage 2014-11-06 20:54:29 -05:00
Douglas Christopher Wilson 59f2b4048a Remove acceptsEncoding 2014-11-06 20:53:17 -05:00
Douglas Christopher Wilson 7f2532808a Remove req.acceptsCharset 2014-11-06 20:52:14 -05:00
Douglas Christopher Wilson dcc4eaabe8 Change req.query to a getter 2014-11-06 20:18:48 -05:00
Douglas Christopher Wilson 085a29685a Change req.host to return host 2014-11-06 20:18:37 -05:00
Douglas Christopher Wilson 3dca534995 Merge tag '3.17.1' 2014-09-08 23:48:59 -04:00
Douglas Christopher Wilson 70767b19ac Fix error in req.subdomains on empty host 2014-09-08 23:45:34 -04:00
Douglas Christopher Wilson 2de6514b4b Support IP address host in req.subdomains
fixes #2308
2014-09-08 23:04:06 -04:00
Douglas Christopher Wilson d07c06363f Support X-Forwarded-Host in req.subdomains 2014-09-08 23:02:42 -04:00
Douglas Christopher Wilson f724730e1a Adjust wording on deprecation messages 2014-07-26 17:36:39 -04:00
Ashley StrebandDouglas Christopher Wilson 11c74d72eb Fix req.protocol for proxy-direct connections
fixes #2252
2014-07-23 16:08:20 -04:00
Ashley StrebandDouglas Christopher Wilson a28b7a85cf Fix req.protocol for proxy-direct connections
fixes #2252
2014-07-23 00:19:10 -04:00