PR #224 introduced a feature where req.hostname get's calculated from the Host header, but it wrongly truncates it to the 2 upper domains.
For example:
example.com will continue being example.com ✅
mercadolibre.com.ar will get truncated to .com.ar ❌
Solution
req.hostname should reflect exactly the same value as the Host header, without the port information if it was included, and all subdomains must be included.
Reference
For reference, here we can see how Express calculates the hostname value.
Bug
PR #224 introduced a feature where
req.hostname
get's calculated from theHost
header, but it wrongly truncates it to the 2 upper domains.For example:
example.com
will continue beingexample.com
✅mercadolibre.com.ar
will get truncated to.com.ar
❌Solution
req.hostname
should reflect exactly the same value as theHost
header, without the port information if it was included, and all subdomains must be included.Reference
For reference, here we can see how Express calculates the
hostname
value.