]> git.ipfire.org Git - thirdparty/curl.git/commit
hostip: make 'localhost' return fixed values
authorDaniel Stenberg <daniel@haxx.se>
Mon, 31 May 2021 06:33:44 +0000 (08:33 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 31 May 2021 13:37:37 +0000 (15:37 +0200)
commit1a0ebf6632f889eedd42e03db9c337e7f029cc21
tree76749fbd6a56853039db5a595f54e3b60e21a475
parent772eacb2e32c65e0e6c63aa8050f7e65e6af696e
hostip: make 'localhost' return fixed values

Resolving the case insensitive host name 'localhost' now returns the
addresses 127.0.0.1 and (if IPv6 is enabled) ::1 without using any
resolver.

This removes the risk that users accidentally resolves 'localhost' to
something else. By making sure 'localhost' is always local, we can
assume a "secure context" for such transfers (for cookies etc).

Closes #7039
lib/hostip.c