pistacheio / pistache

A high-performance REST toolkit written in C++
https://pistacheio.github.io/pistache/
Apache License 2.0
3.12k stars 688 forks source link

fix(net): drop special localhost handling #1138

Closed Tachi107 closed 1 year ago

Tachi107 commented 1 year ago

It is unnecessary to special-case the "localhost" domain name, as documents like RFC 6761 (section 6.3) already define its semantics. It should hence be simply passed to getaddrinfo(), so that the proper loopback address is returned.

On the other hand, using "*" as a shorthand for "0.0.0.0" is not universally accepted, so Pistache should continue handle it specifically for backwards compatibility.

This restores getaddrinfo() coverage regressed by commit 50e39e1afd778fed64b8925ba054e7653c58541c.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.13 :warning:

Comparison is base (e884d6d) 78.60% compared to head (01003e7) 78.47%.

:exclamation: Current head 01003e7 differs from pull request most recent head 363629b. Consider uploading reports for the commit 363629b to get more accurate results

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1138 +/- ## ========================================== - Coverage 78.60% 78.47% -0.13% ========================================== Files 53 53 Lines 6884 6881 -3 ========================================== - Hits 5411 5400 -11 - Misses 1473 1481 +8 ``` | [Impacted Files](https://app.codecov.io/gh/pistacheio/pistache/pull/1138?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [src/common/net.cc](https://app.codecov.io/gh/pistacheio/pistache/pull/1138?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2NvbW1vbi9uZXQuY2M=) | `87.41% <ø> (-0.14%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/pistacheio/pistache/pull/1138/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

dennisjenkins75 commented 1 year ago

LGTM