1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-01 09:51:46 -05:00
Daniel Stenberg 56a037cc0a
urlapi: "normalize" numerical IPv4 host names
When the host name in a URL is given as an IPv4 numerical address, the
address can be specified with dotted numericals in four different ways:
a32, a.b24, a.b.c16 or a.b.c.d and each part can be specified in
decimal, octal (0-prefixed) or hexadecimal (0x-prefixed).

Instead of passing on the name as-is and leaving the handling to the
underlying name functions, which made them not work with c-ares but work
with getaddrinfo, this change now makes the curl URL API itself detect
and "normalize" host names specified as IPv4 numericals.

The WHATWG URL Spec says this is an okay way to specify a host name in a
URL. RFC 3896 does not allow them, but curl didn't prevent them before
and it seems other RFC 3896-using tools have not either. Host names used
like this are widely supported by other tools as well due to the
handling being done by getaddrinfo and friends.

I decided to add the functionality into the URL API itself so that all
users of these functions get the benefits, when for example wanting to
compare two URLs. Also, it makes curl built to use c-ares now support
them as well and make curl builds more consistent.

The normalization makes HTTPS and virtual hosted HTTP work fine even
when curl gets the address specified using one of the "obscure" formats.

Test 1560 is extended to verify.

Fixes #6863
Closes #6871
2021-04-19 08:34:55 +02:00
..
2020-07-28 23:51:17 +02:00
2020-08-26 22:53:02 +02:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2021-01-02 23:35:59 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2021-02-10 16:47:09 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-12-17 16:55:56 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-05 08:22:10 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00
2020-11-04 23:59:47 +01:00