Skip to content

Commit d44da2e

Browse files
committed
Use "localhost" for net/http only on Windows where it seems necessary
* On other platforms, 127.0.0.1 is much more reliable and required in some cases.
1 parent be04612 commit d44da2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/ruby/library/net/http/http/fixtures/http_server.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ def port
6363
end
6464

6565
def start_server
66+
bind_address = platform_is(:windows) ? "localhost" : "127.0.0.1"
6667
server_config = {
67-
BindAddress: "localhost",
68+
BindAddress: bind_address,
6869
Port: 0,
6970
Logger: WEBrick::Log.new(NullWriter.new),
7071
AccessLog: [],

0 commit comments

Comments
 (0)