Go to file
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
.github configure: provide --with-openssl, deprecate --with-ssl 2021-04-15 09:08:34 +02:00
.muse
CMake configure: remove use of RETSIGTYPE 2021-04-07 16:01:05 +02:00
docs hsts: enable by default 2021-04-19 08:22:16 +02:00
include RELEASE-NOTES: synced 2021-04-15 08:24:19 +02:00
lib urlapi: "normalize" numerical IPv4 host names 2021-04-19 08:34:55 +02:00
m4 configure: include <time.h> unconditionally 2021-04-07 16:08:01 +02:00
packages configure: remove use of RETSIGTYPE 2021-04-07 16:01:05 +02:00
plan9
projects copyright: update copyright year ranges to 2021 2021-03-27 23:00:14 +01:00
scripts docs: document version of crustls dependency 2021-03-21 00:16:32 +01:00
src curl: ignore options asking for SSLv2 or SSLv3 2021-04-19 08:14:05 +02:00
tests urlapi: "normalize" numerical IPv4 host names 2021-04-19 08:34:55 +02:00
winbuild winbuild: remove docs from Makefiles and refer to README.md 2020-11-22 23:02:25 +01:00
.azure-pipelines.yml test972: verify the json output with jsonlint 2021-04-17 11:03:40 +02:00
.cirrus.yml copyright: update copyright year ranges to 2021 2021-03-27 23:00:14 +01:00
.dcignore
.dir-locals.el
.gitattributes gitattributes: Set batch files to CRLF line endings on checkout 2021-01-14 15:59:56 -05:00
.gitignore
.lgtm.yml
.mailmap mailmap: Jon Rumsey 2021-02-05 08:46:11 +01:00
.travis.yml configure: provide --with-openssl, deprecate --with-ssl 2021-04-15 09:08:34 +02:00
acinclude.m4 configure: include <time.h> unconditionally 2021-04-07 16:08:01 +02:00
appveyor.yml
buildconf
buildconf.bat
CHANGES
CMakeLists.txt hsts: enable by default 2021-04-19 08:22:16 +02:00
configure.ac hsts: enable by default 2021-04-19 08:22:16 +02:00
COPYING COPYING/configure: bump copyright year range 2021-01-01 00:52:28 +01:00
curl-config.in
GIT-INFO
libcurl.pc.in Revert "libcurl.pc: make it relocatable" 2020-11-09 09:13:06 +01:00
MacOSX-Framework
Makefile.am Revert "libcurl.pc: make it relocatable" 2020-11-09 09:13:06 +01:00
Makefile.dist configure: provide --with-openssl, deprecate --with-ssl 2021-04-15 09:08:34 +02:00
maketgz
README
README.md
RELEASE-NOTES RELEASE-NOTES: synced 2021-04-15 08:24:19 +02:00
SECURITY.md

curl logo

CII Best Practices Coverity passed Travis-CI Build Status AppVeyor Build Status Azure DevOps Build Status Cirrus Build Status Backers on Open Collective Sponsors on Open Collective Language Grade: C/C++ Codacy Badge Fuzzing Status

Curl is a command-line tool for transferring data specified with URL syntax. Find out how to use curl by reading the curl.1 man page or the MANUAL document. Find out how to install Curl by reading the INSTALL document.

libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl.3 man page to learn how!

You can find answers to the most frequent questions we get in the FAQ document.

Study the COPYING file for distribution terms.

Contact

If you have problems, questions, ideas or suggestions, please contact us by posting to a suitable mailing list.

All contributors to the project are listed in the THANKS document.

Website

Visit the curl website for the latest news and downloads.

Git

To download the very latest source from the Git server do this:

git clone https://github.com/curl/curl.git

(you'll get a directory named curl created, filled with the source code)

Security problems

Report suspected security problems via our HackerOne page and not in public!

Notice

Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan. This notice is included here to comply with the distribution terms.

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]