Skip to content

Commit dddae18

Browse files
committed
docs: update History.md to include bug fix for HTTP header conflict in res.send()
1 parent 1f2ab4b commit dddae18

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

History.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Unreleased Changes
22

3+
## 🐞 Bug fixes
4+
5+
- Fixed HTTP header conflict between Content-Length and Transfer-Encoding in res.send - by [@YuryShkoda](https://github.com/YuryShkoda) in [#4893](https://github.com/expressjs/express/pull/4893)
6+
7+
8+
Fixed the behavior of `res.send()` to prevent conflicts between `Content-Length` and `Transfer-Encoding` HTTP headers in responses. The `Content-Length` header in `res.send()` is now only added when a `Transfer-Encoding` header is not present, complying with the HTTP specification that states both headers should not coexist in the same response
9+
310
## 🚀 Improvements
411

512
- Improve HTML structure in `res.redirect()` responses when HTML format is accepted by adding `<!DOCTYPE html>`, `<title>`, and `<body>` tags for better browser compatibility - by [@Bernice55231](https://github.com/Bernice55231) in [#5167](https://github.com/expressjs/express/pull/5167)

lib/response.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ res.send = function send(body) {
168168
var etagFn = app.get('etag fn')
169169
var generateETag = !this.get('ETag') && typeof etagFn === 'function'
170170

171-
// populate Content-Length
172171
// Because Content-Length and Transfer-Encoding can't be present in the response headers together,
173172
// Content-Length should be added only if there is no Transfer-Encoding header
174173
var len;

0 commit comments

Comments
 (0)