Skip to content

hostip: make 'localhost' return fixed values #7039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

bagder
Copy link
Member

@bagder bagder commented May 10, 2021

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).

@bagder bagder added the name lookup DNS and related tech label May 10, 2021
@bagder bagder force-pushed the bagder/fixed-localhost branch from 2b298a2 to fab6d74 Compare May 10, 2021 22:54
@bagder bagder added the feature-window A merge of this requires an open feature window label May 12, 2021
@bagder
Copy link
Member Author

bagder commented May 12, 2021

Tagged for merge after 7.77.0 ships.

bagder added 2 commits May 31, 2021 08:33
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).
@bagder bagder force-pushed the bagder/fixed-localhost branch from 2662b69 to c7997d6 Compare May 31, 2021 06:34
@bagder bagder removed the feature-window A merge of this requires an open feature window label May 31, 2021
@bagder bagder closed this in 1a0ebf6 May 31, 2021
@bagder bagder deleted the bagder/fixed-localhost branch May 31, 2021 13:42
vszakats added a commit to vszakats/curl that referenced this pull request Dec 16, 2024
Nobody bumping into this for 4 years suggests that this feature
check may be obsolete.

use: 645729e (2005)
auto-detection: 6efde61 (2008)

Follow-up to 1a0ebf6 curl#7039
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
name lookup DNS and related tech
Development

Successfully merging this pull request may close these issues.

1 participant