You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Hosts option doesn't work well with non-lowercase hosts, and it causes the k6/http module to fail with connect: connection refused even before actually trying to perform any HTTP request.
The problem seems to be originated in the Hosts type, and more specifically in the Hosts.Match, because the internal trie succesfully reports the match, but then the Match function uses the lowercased host to lookup in the map, so if the user didn't specify the host in strict lowercase, it would return an empty host (wouldn't find it).
I've been able to successfully reproduce this issue since v0.42.0 and up to v0.49.0 (including master).
Brief summary
The
Hosts
option doesn't work well with non-lowercase hosts, and it causes thek6/http
module to fail withconnect: connection refused
even before actually trying to perform any HTTP request.The problem seems to be originated in the
Hosts
type, and more specifically in theHosts.Match
, because the internal trie succesfully reports the match, but then theMatch
function uses the lowercased host to lookup in the map, so if the user didn't specify the host in strict lowercase, it would return an empty host (wouldn't find it).I've been able to successfully reproduce this issue since
v0.42.0
and up tov0.49.0
(includingmaster
).Related with #3620
k6 version
v0.49.0
OS
Any
Docker version and image (if applicable)
No response
Steps to reproduce the problem
Run any k6 test script with a non-lowercase host (see the example below):
Expected behaviour
The script execution shouldn't fail despite of the case used to describe the host, as hosts are considered case insensitive as per DNS.
Actual behaviour
Since
v0.42.0
(and most specifically, probably since120436b610070f85f04c524fb20c35202627fcea
) it fails with:before actually trying to perform any HTTP request.
The text was updated successfully, but these errors were encountered: