← expressjs/express

CODEFOSSIL · express

res.send

method in lib/response.js:126 · Born 2011-02-04 (DERIVED, confidence 1.00)

15years old
78changes
17fixes
23authors
64callers
2012201320142015201620172018201920202021202220232024202520262011-02-23 770f05c styling2011-03-01 5052128 utilizing nodes progressive response header api2011-03-02 3661922 refactored res.send()2011-03-09 acbf224 default res.send() string charset to utf82011-03-12 3a1fe1e Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP]2011-03-17 5da0163 Fixed SlowBuffer support. Closes #5842011-03-17 4874404 typo2011-03-21 b7232f3 Added res.send(bool) support2011-03-29 673ba22 res.send(undefined) returns a 2042011-04-20 8f054db JSON and JSONP default to UTF-8 in the same way as HTML. Introduces app.set('charset') to set charset default at the application level. Closes #632.2011-04-20 3afbcd0 JSON and JSONP default to UTF-8 in the same way as HTML. Closes #632.2011-05-23 9d498ba misc2011-06-08 9028cac Fixed; ignore body on 304. Closes #7012011-06-28 1386f80 Added res.json() and tests2011-07-06 2aaf0de res.send() using res.json()2011-07-11 b13ec85 Removed `res.send()` with no args support for 2042011-07-14 232b6ab Removed `res.send()` with no args support for 2042011-07-15 bcfcce3 Removed header field support2011-07-15 d853f6c fixed some tests2011-07-22 5ac5352 Fixed [23]04 support2011-07-29 376bedf Changed `res.send(null)` responds with empty string2011-07-29 c631eb4 Fixed 204 / 304 responses2011-08-04 c35cd7f Changed `res.{send,json}()` status code to the first arg at all times2011-09-07 2c734e2 refactored `res.send()`2012-02-07 c44f018 utilize `res.set()` internally2012-04-22 0f58593 Make string object behave like string literals with res.send2012-04-25 b809041 refactored res.send()2012-04-26 7c2e1ad .contentType -> .type() in core2012-04-27 a58e3de Added conditional-GET support to res.send()2012-04-27 809e0b8 merged2012-04-29 c0a68fc Added Buffer ETag support to res.send()2012-05-02 1a3e40d Changed: res.send() only set ETag when not previously set2012-06-15 640cf4c Changed: res.send() always checks freshness2012-06-15 108e66c Fixed `res.send()` freshness check, respect res.statusCode2012-06-15 ce7293d misc2012-06-15 d073e0a Added 2xx / 304 check to req.fresh2012-06-21 3c0c961 Added `res.send(body, status)` support back for backwards compat2012-07-24 214f913 merge2012-08-30 f2f0976 add etag util2012-09-26 f0d5b3b remove non-primitive string support for `res.send()`2012-12-06 6f6eec7 add 'etag' option2012-12-06 9bd86cd Revert "add 'etag' option"2012-12-19 a1e42ac Explicitly remove Transfer-Encoding header from 204 and 304 responses2013-05-10 3296ed9 change generation of ETags with res.send() to GET requests only. Closes #16192013-05-13 28b8a3b fix infinite loop when res.send(status) is undefined. Closes #16232013-05-13 10b21b4 Revert "fix infinite loop when res.send(status) is undefined. Closes #1623"2013-07-21 54a192a Add application setting to disable ETag completely2013-08-02 8ad8cb9 refactor2013-10-31 55d1a4f always send ETag when content-length > 02014-03-08 2064f41 remove res.charset usage2014-04-30 3c7310e Include ETag in HEAD requests2014-05-21 f14e39d set proper charset in content-type for res.send2014-05-29 3c0ec59 Include ETag in HEAD requests2014-05-31 c21226a improve etag control for res.send2014-06-23 ba8a4c5 add deprecation message to res.send(body, status)2014-07-11 544c666 Fix res.send(status, num) to send num as json2014-07-11 c6e6203 perf: fix arguments reassign deopt in some res methods2014-07-14 b43205c perf: prevent multiple Buffer creation in res.send2014-07-18 fd3b405 Deprecate combined status, response signatures2014-10-23 4dd9705 Fix res.send to mention res.sendStatus2014-11-07 e66625b Remove res.send(body, status) signature2014-11-07 97ccc52 Remove res.send(status) signature2014-12-10 c24463d Fix res.send double-calling res.end for HEAD requests2015-02-18 eaf3318 Generate ETags for all request responses2015-06-19 91731b4 perf: use saved reference to http.STATUS_CODES2016-05-31 b69b760 perf: use strict equality when possible2017-02-22 034165c Use statuses instead of http module for status messages2017-08-08 e3bd14d Remove res.send(status, body) signature2017-09-26 48940e6 Skip Buffer encoding when not generating ETag for small response2017-09-28 12c3712 Use safe-buffer for improved Buffer API2017-10-10 b7817ab Fix TypeError in res.send when given Buffer and ETag header set2022-03-24 87279c0 Support proper 205 responses using res.send2022-04-03 980d881 deps: statuses@2.0.12024-07-30 723b545 Throw on invalid status codes (#4212)2025-02-10 55869f4 feat: Added check to support Uint8Array in response sending (#6285)2026-01-19 a479419 feat: do not modify the Content-Type twice when sending strings (#6991)2026-06-16 18e5985 fix(res.send): add Content-Length header only if Transfer-Encoding is not present (#4893)2026-09-15 9a34acf fix(res.send): preserve ETag generation with Transfer-Encoding (#7459)2011-02-04 99820e7 Refactored req/res proto assignments
Every commit that changed it, 2011-02-04 – 2026-09-15. Raised orange dots are fixes.
  1. Changed fix(res.send): preserve ETag generation with Transfer-Encoding (#7459)

    9a34acf · cui fliter fix · INFERRED

  2. Changed fix(res.send): add Content-Length header only if Transfer-Encoding is not present (#4893)

    18e5985 · Yury Shkoda fix · INFERRED

  3. Changed feat: do not modify the Content-Type twice when sending strings (#6991)

    a479419 · Sebastian Beltran

  4. Changed feat: Added check to support Uint8Array in response sending (#6285)

    55869f4 · Alexander Cerutti

  5. Changed Throw on invalid status codes (#4212)

    723b545 · Jon Church

  6. Changed deps: statuses@2.0.1

    980d881 · 3imed-jaberi

  7. Changed Support proper 205 responses using res.send

    87279c0 · Tito D. Kesumo Siregar

  8. Changed Fix TypeError in res.send when given Buffer and ETag header set

    b7817ab · David Wood fix · INFERRED

  9. Changed Use safe-buffer for improved Buffer API

    12c3712 · Douglas Christopher Wilson

  10. Changed Skip Buffer encoding when not generating ETag for small response

    48940e6 · Douglas Christopher Wilson

  11. Changed Remove res.send(status, body) signature

    e3bd14d · Mike Tunnicliffe

  12. Changed Use statuses instead of http module for status messages

    034165c · Wes

  13. Changed perf: use strict equality when possible

    b69b760 · Ángel Sanz

  14. Changed perf: use saved reference to http.STATUS_CODES

    91731b4 · Thomas Cort

  15. Changed Generate ETags for all request responses

    eaf3318 · Douglas Christopher Wilson

  16. Changed Fix res.send double-calling res.end for HEAD requests

    c24463d · Douglas Christopher Wilson fix · INFERRED

  17. Changed Remove res.send(status) signature

    97ccc52 · Douglas Christopher Wilson

  18. Changed Remove res.send(body, status) signature

    e66625b · Douglas Christopher Wilson

  19. Changed Fix res.send to mention res.sendStatus

    4dd9705 · Douglas Christopher Wilson fix · INFERRED

  20. Changed Deprecate combined status, response signatures

    fd3b405 · Douglas Christopher Wilson

  21. Changed perf: prevent multiple Buffer creation in res.send

    b43205c · Douglas Christopher Wilson

  22. Changed perf: fix arguments reassign deopt in some res methods

    c6e6203 · Douglas Christopher Wilson fix · INFERRED

  23. Changed Fix res.send(status, num) to send num as json

    544c666 · Yad Smood fix · INFERRED

  24. Changed add deprecation message to res.send(body, status)

    ba8a4c5 · Douglas Christopher Wilson

  25. Changed improve etag control for res.send

    c21226a · Douglas Christopher Wilson

  26. Changed Include ETag in HEAD requests

    3c0ec59 · Tiago Relvao

  27. Changed set proper charset in content-type for res.send

    f14e39d · Douglas Christopher Wilson

  28. Changed Include ETag in HEAD requests

    3c7310e · Tiago Relvao

  29. Changed remove res.charset usage

    2064f41 · Jonathan Ong

  30. Changed always send ETag when content-length > 0

    55d1a4f · Jonathan Ong

  31. Changed refactor

    8ad8cb9 · TJ Holowaychuk

  32. Changed Add application setting to disable ETag completely

    54a192a · Max Riveiro

  33. Changed Revert "fix infinite loop when res.send(status) is undefined. Closes #1623"

    10b21b4 · TJ Holowaychuk fix · INFERRED

  34. Changed fix infinite loop when res.send(status) is undefined. Closes #1623

    28b8a3b · TJ Holowaychuk fix · INFERRED

  35. Changed change generation of ETags with res.send() to GET requests only. Closes #1619

    3296ed9 · TJ Holowaychuk

  36. Changed Explicitly remove Transfer-Encoding header from 204 and 304 responses

    a1e42ac · Alex Weeks

  37. Changed Revert "add 'etag' option"

    9bd86cd · TJ Holowaychuk fix · INFERRED

  38. Changed add 'etag' option

    6f6eec7 · Max Riveiro

  39. Changed remove non-primitive string support for `res.send()`

    f0d5b3b · TJ Holowaychuk

  40. Changed add etag util

    f2f0976 · TJ Holowaychuk

  41. Changed merge

    214f913 · TJ Holowaychuk

  42. Changed Added `res.send(body, status)` support back for backwards compat

    3c0c961 · TJ Holowaychuk

  43. Changed Added 2xx / 304 check to req.fresh

    d073e0a · TJ Holowaychuk

  44. Changed misc

    ce7293d · TJ Holowaychuk

  45. Changed Fixed `res.send()` freshness check, respect res.statusCode

    108e66c · TJ Holowaychuk fix · INFERRED

  46. Changed Changed: res.send() always checks freshness

    640cf4c · TJ Holowaychuk

  47. Changed Changed: res.send() only set ETag when not previously set

    1a3e40d · TJ Holowaychuk

  48. Changed Added Buffer ETag support to res.send()

    c0a68fc · TJ Holowaychuk

  49. Changed merged

    809e0b8 · TJ Holowaychuk

  50. Changed Added conditional-GET support to res.send()

    a58e3de · TJ Holowaychuk

  51. Changed .contentType -> .type() in core

    7c2e1ad · TJ Holowaychuk

  52. Changed refactored res.send()

    b809041 · TJ Holowaychuk

  53. Changed Make string object behave like string literals with res.send

    0f58593 · Pierre Matri

  54. Changed utilize `res.set()` internally

    c44f018 · TJ Holowaychuk

  55. Changed refactored `res.send()`

    2c734e2 · Tj Holowaychuk

  56. Changed Changed `res.{send,json}()` status code to the first arg at all times

    c35cd7f · Tj Holowaychuk

  57. Changed Fixed 204 / 304 responses

    c631eb4 · Tj Holowaychuk fix · INFERRED

  58. Changed Changed `res.send(null)` responds with empty string

    376bedf · Tj Holowaychuk

  59. Changed Fixed [23]04 support

    5ac5352 · Tj Holowaychuk fix · INFERRED

  60. Changed fixed some tests

    d853f6c · Tj Holowaychuk fix · INFERRED

  61. Changed Removed header field support

    bcfcce3 · Tj Holowaychuk

  62. Changed Removed `res.send()` with no args support for 204

    232b6ab · Tj Holowaychuk

  63. Changed Removed `res.send()` with no args support for 204

    b13ec85 · Tj Holowaychuk

  64. Changed res.send() using res.json()

    2aaf0de · Tj Holowaychuk

  65. Changed Added res.json() and tests

    1386f80 · Tj Holowaychuk

  66. Changed Fixed; ignore body on 304. Closes #701

    9028cac · Tj Holowaychuk fix · INFERRED

  67. Changed misc

    9d498ba · Tj Holowaychuk

  68. Changed JSON and JSONP default to UTF-8 in the same way as HTML. Closes #632.

    3afbcd0 · Daniel Shaw

  69. Changed JSON and JSONP default to UTF-8 in the same way as HTML. Introduces app.set('charset') to set charset default at the application level. Closes #632.

    8f054db · Daniel Shaw

  70. Changed res.send(undefined) returns a 204

    673ba22 · Aaron Heckmann

  71. Changed Added res.send(bool) support

    b7232f3 · Tj Holowaychuk

  72. Changed typo

    4874404 · Tj Holowaychuk

  73. Changed Fixed SlowBuffer support. Closes #584

    5da0163 · Tj Holowaychuk fix · INFERRED

  74. Changed Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP]

    3a1fe1e · Tj Holowaychuk fix · INFERRED

  75. Changed default res.send() string charset to utf8

    acbf224 · Tj Holowaychuk

  76. Changed refactored res.send()

    3661922 · Tj Holowaychuk

  77. Changed utilizing nodes progressive response header api

    5052128 · Tj Holowaychuk

  78. Changed styling

    770f05c · Tj Holowaychuk

  79. Born Refactored req/res proto assignments

    99820e7 · Tj Holowaychuk