net.http: set IP address for HTTP server during tests#24698
Conversation
On OpenBSD, TCP connect fails (return EINVAL) if attempted with 0.0.0.0 address. Signed-off-by: Laurent Cheylus <foxy@free.fr>
|
Connected to Huly®: V_0.6-23053 |
|
Believe it or not, some versions of Windows do not set 127.0.0.1 in their hosts file, so this could break on them. This change will also be a problem on systems with IP6 as the default/only scheme. |
No issue in Windows CI with my fix :)
This fix is only for tests of HTTP server. I doubt any serious developer would use a system with only an IPv6 stack. So I think that my fix is not a problem. And it allows that every test runned with |
|
We can make the ip setting conditional on the platform, if there are problems in the future. |
|
|
On OpenBSD, TCP connect fails (return EINVAL) if attempted with 0.0.0.0 address.
In
vlib/net/http/server_test.v, for teststest_server_custom_handlerandtest_host_header_sent_to_server, use 127.0.0.1 as IP addr for the HTTP server.Fix #22126
Tests OK on OpenBSD/amd64 and Linux/amd64 with tcc, clang and gcc