Commit Graph

84 Commits

Author SHA1 Message Date
Shivam Sharma
98c85eb0dd
chore: enforce explicit Buffer import and add lint rule (#6525)
Signed-off-by: Shivam Sharma <meshivam81@gmail.com>
2025-06-27 20:10:36 -05:00
Alexander Cerutti
55869f49a6 feat: Added check to support Uint8Array in response sending (#6285)
Unified usage of ArrayBuffer.isView to comprehend Buffer and removed isView function check

Co-authored-by: Wes Todd <wes@wesleytodd.com>

Added Uint8Array test with encoding

fix: added history.md entry
2025-02-10 11:23:02 -06:00
Szymon Łągiewka
41113599af 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 Koops
b11122be85
chore: replace methods dependency with standard library (#6196) 2025-01-02 08:00:30 +01:00
Phillip9587
9f8589e31c cleanup: remove unnecessary require for global Buffer
The Buffer object is globally available in Node.js, so there is no need to explicitly require it.
2024-11-15 10:16:29 -06:00
Bhavya Dhiman
c70197ad33
fix(buffer): use node:buffer instead of safe-buffer (#6071)
Main Changes:
- Removed dependency `safe-buffer@5.2.1`
- Use `node:buffer` core library instead of safe-buffer
2024-10-27 11:10:33 +01:00
ctcpip
c96c690dc0 Merge branch 'master' into 5.0 2024-07-25 16:55:48 -05:00
Jon Church
61421a8c0c
skip QUERY tests for Node 21 only, still not supported (#5695)
* skip QUERY tests for Node 21 only, still not supported

QUERY support has now landed in Node 22.2.0, but is still not supported
in 21.7.3

QUERY showed up in http.METHODS in 21.7.2. Only Node versions after that
will attempt to run tests for it, based on the way we dynamically test
members of the http.METHODS array from Node

* update CI to run on 21.7 and 22.2
2024-06-08 23:25:42 -04:00
Jon Church
b44191eb3d
ignore ETAG query test as well, reuse skip util (#5639) 2024-05-04 18:01:42 -04:00
Wes Todd
e9f9aaeebd Merge tag '4.19.0' into 5.x
4.19.0
2024-03-20 21:14:00 -05:00
Tito D. Kesumo Siregar
87279c08aa Support proper 205 responses using res.send
closes #4592
closes #4596
2022-03-23 20:05:05 -04:00
Douglas Christopher Wilson
18f782bba9 tests: remove duplicate utils 2022-02-23 00:18:36 -05:00
Douglas Christopher Wilson
318fd4b543 Merge tag '4.17.3' 2022-02-17 00:27:11 -05:00
Douglas Christopher Wilson
a65913776d tests: use strict mode 2022-02-09 01:07:08 -05:00
Douglas Christopher Wilson
bd4fdfe5f7 tests: remove global dependency on should
fixes #4797
2022-02-02 01:55:16 -05:00
Douglas Christopher Wilson
302a6152b4 Merge tag '4.16.4' 2018-10-23 20:38:42 -04:00
Douglas Christopher Wilson
451ee5d9c1 build: supertest@3.3.0 2018-09-24 23:40:21 -04:00
chainhelen
950f4423f0 tests: separate res.send() chain test
closes #3448
2018-01-02 19:26:27 -05:00
Douglas Christopher Wilson
62e12fe710 Merge tag '4.16.2' 2017-10-13 22:27:30 -04:00
David Wood
b7817ab1b0 Fix TypeError in res.send when given Buffer and ETag header set
fixes #3445
2017-10-09 22:11:49 -04:00
Douglas Christopher Wilson
12c3712468 Use safe-buffer for improved Buffer API 2017-09-28 08:26:39 -04:00
Mike Tunnicliffe
e3bd14dcca Remove res.send(status, body) signature
closes #2942
2017-08-07 20:06:44 -04:00
Douglas Christopher Wilson
c319fe260a Merge tag '4.15.4' 2017-08-07 19:33:00 -04:00
Douglas Christopher Wilson
e0066227f7 lint: remove all unused varaibles 2017-08-06 00:19:32 -04:00
Douglas Christopher Wilson
501e24e0a9 Merge tag '4.15.0' 2017-03-01 18:17:04 -05:00
Douglas Christopher Wilson
9f4dbae083 deps: etag@~1.8.0 2017-02-20 21:25:26 -05:00
Douglas Christopher Wilson
1dbfee6623 Merge tag '4.14.0' 2016-06-20 00:37:34 -04:00
Douglas Christopher Wilson
12bc16e72f tests: use supertest to check response header values
closes #2983
closes #2992
2016-05-11 08:50:38 +02:00
Douglas Christopher Wilson
7cafdb5824 Merge tag '4.13.4' 2016-01-21 21:23:07 -05:00
Ricardo Bin
7a3b5aea11 tests: add test for res.send() without arguments
closes #2778
closes #2783
2015-11-07 00:25:06 -05:00
Douglas Christopher Wilson
b309b873f1 Merge tag '4.13.1' 2015-07-06 16:13:54 -04:00
Douglas Christopher Wilson
3d2ecdd5fa Merge tag '3.21.0' 2015-06-18 22:10:21 -04:00
Douglas Christopher Wilson
c8d61b6269 deps: etag@~1.7.0
fixes #2667
2015-06-18 20:54:26 -04:00
Douglas Christopher Wilson
f90e045334 Merge tag '4.12.4' 2015-05-18 00:41:42 -04:00
Douglas Christopher Wilson
c894c84e4a build: support io.js 1.x
closes #2539
2015-03-17 02:09:39 -04:00
Douglas Christopher Wilson
f6ec710534 Merge tag '4.12.0' 2015-02-23 01:00:12 -05:00
Douglas Christopher Wilson
531f024e48 Merge tag '3.20.0' 2015-02-18 22:33:47 -05:00
Douglas Christopher Wilson
eaf3318dd3 Generate ETags for all request responses
closes #2546
2015-02-18 00:12:28 -05:00
Douglas Christopher Wilson
97ccc52207 Remove res.send(status) signature 2014-11-06 21:20:46 -05:00
Douglas Christopher Wilson
e66625be50 Remove res.send(body, status) signature 2014-11-06 20:18:39 -05:00
Douglas Christopher Wilson
4d1ee23f84 Use etag module to generate ETag headers 2014-10-18 00:53:17 -04:00
Douglas Christopher Wilson
51d33edb79 Use etag to generate ETag headers 2014-09-09 00:13:49 -04:00
Douglas Christopher Wilson
b43205ca98 perf: prevent multiple Buffer creation in res.send 2014-07-13 21:14:30 -04:00
Douglas Christopher Wilson
4ea6f21b02 Merge tag '3.14.0' 2014-07-11 16:28:37 -04:00
Yad Smood
544c6665f5 Fix res.send(status, num) to send num as json
fixes #2226
2014-07-10 23:19:57 -04:00
Douglas Christopher Wilson
db4448dda8 Merge tag '3.9.0' 2014-05-30 22:17:51 -04:00
Douglas Christopher Wilson
c21226aa7c improve etag control for res.send
closes #1435
closes #2129
2014-05-30 21:02:21 -04:00
Douglas Christopher Wilson
3e358458f4 tests: add more etag tests 2014-05-30 19:51:32 -04:00
Douglas Christopher Wilson
8ab96ab80d mark res.send ETag as weak and reduce collisions 2014-05-29 23:14:21 -04:00
Douglas Christopher Wilson
db4a061ed6 Merge tag '3.8.0' 2014-05-21 02:08:04 -04:00