[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#40582: Valid URIs are rejected
From: |
Ludovic Courtès |
Subject: |
bug#40582: Valid URIs are rejected |
Date: |
Thu, 18 Jun 2020 17:07:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hi,
Julien Lepiller <julien@lepiller.eu> skribis:
> Le 17 juin 2020 17:57:33 GMT-04:00, "Ludovic Courtès" <ludo@gnu.org> a écrit :
[...]
>>The regexp below is still an approximation, but I think a better one.
>>Can you confirm?
>>
>>Thanks,
>>Ludo’.
>
> Looks slightly better, thanks.
>
> That's still incorrect, as it will match things that are not ipv6 addresses.
> Does it have to be a regexp though? Why not simply check (false-if-exception
> (inet-pton AF_INET6 host)), as in the return value of valid-host?
Using a regexp makes the code closer to the RFC since the RFC explicitly
describes the grammar. It’s also the simple choice here.
> There's also a ipv6-host-pat that has an incorrect regexp, but I'm not sure
> what it is used for.
It’s use for ‘authority-regexp’, but that one is fine: it requires
square brackets around IPv6 addresses.
Pushed as 1ab2105339f60dba20c8c9680e49110501f3a6a0.
Thanks,
Ludo’.