urlapi: consume trailing dots after IPv4 numerical addresses

If the hostname is specified as an IPv4 numerical address and it is
followed by a single dot, acccept that as a valid IPv4 and remove the
dot when normalizing.

This prevents otherwise legitimate IPv4 hostnames to have trailing dots.
Seems to match what browsers do.

Extended test 1560 to verify.

Closes #21635
This commit is contained in:
Daniel Stenberg 2026-05-15 17:04:26 +02:00
parent aafbe089a8
commit 831a151484
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 40 additions and 11 deletions

View file

@ -37,7 +37,7 @@ lib%TESTNUMBER
success
</stdout>
<limits>
Allocations: 3100
Allocations: 3200
</limits>
</verify>
</testcase>