GNU bug report logs - #40582
Valid URIs are rejected

Previous Next

Package: guile;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Sun, 12 Apr 2020 19:45:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#40582: closed (Valid URIs are rejected)
Date: Thu, 18 Jun 2020 15:09:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 18 Jun 2020 17:07:57 +0200
with message-id <871rmcjtte.fsf <at> gnu.org>
and subject line Re: bug#40582: Valid URIs are rejected
has caused the debbugs.gnu.org bug report #40582,
regarding Valid URIs are rejected
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
40582: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40582
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Julien Lepiller <julien <at> lepiller.eu>
To: bug-guile <at> gnu.org
Subject: Valid URIs are rejected
Date: Sun, 12 Apr 2020 15:44:31 -0400
Hi,

Using (web uri), I was trying to parse "uri://a/c". Reading RFC3986, it should be a valid URI (see rule for reg-name in 3.2.2). However, passing it to string->uri results in #f. I've tracked this down to valid-host? which returns #f for "a".

The reason is that the regexp checking if the host is an ipv6 matches "a", which shouldn't happen because a is not an ipv6 address. Indeed, when I try (string->uri "uri://g/b"), I get the expected result.


[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 40582-done <at> debbugs.gnu.org
Subject: Re: bug#40582: Valid URIs are rejected
Date: Thu, 18 Jun 2020 17:07:57 +0200
Hi,

Julien Lepiller <julien <at> lepiller.eu> skribis:

> Le 17 juin 2020 17:57:33 GMT-04:00, "Ludovic Courtès" <ludo <at> 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’.


This bug report was last modified 4 years and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.