From 70701f53901ad70edffd7d43c165e25016105470 Mon Sep 17 00:00:00 2001 From: Andrew <112019350+andrewkernel@users.noreply.github.com> Date: Tue, 30 Jun 2026 02:14:53 -0500 Subject: [PATCH] fix(req): ignore trailing dot in subdomains --- History.md | 3 ++- lib/request.js | 2 ++ test/req.subdomains.js | 13 +++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index 9e6ee903f40..88897f2afdd 100644 --- a/History.md +++ b/History.md @@ -4,9 +4,10 @@ - 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) - 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 +- Fixed `req.subdomains` handling for fully qualified domain names with a trailing dot, so the root label is ignored when applying the subdomain offset. + ## 🚀 Improvements * Improve HTML structure in `res.redirect()` responses when HTML format is accepted by adding ``, `