diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-06-18 17:02:07 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-06-18 17:06:29 +0200 |
commit | 1ab2105339f60dba20c8c9680e49110501f3a6a0 (patch) | |
tree | 737b10d3110eda349372d545f5a5cb8a776935cf /module/web | |
parent | dfca16fd234c13ff76bbfca20ebc3b0895681bc2 (diff) | |
download | guile-1ab2105339f60dba20c8c9680e49110501f3a6a0.tar.gz |
web: Accept URI host names consisting only of hex digits.
Fixes <https://bugs.gnu.org/40582>.
Reported by Julien Lepiller <julien@lepiller.eu>.
Previously, a host part consisting of hex digits would be mistaken as an
IPv6 address and rejected by 'valid-host?'.
* module/web/uri.scm (ipv6-regexp): Add colon.
* test-suite/tests/web-uri.test ("string->uri")["xyz://abc/x/y/z"]: New
test.
* NEWS: Update.
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/uri.scm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/module/web/uri.scm b/module/web/uri.scm index b4b89b9cc..728444afc 100644 --- a/module/web/uri.scm +++ b/module/web/uri.scm @@ -1,6 +1,6 @@ ;;;; (web uri) --- URI manipulation tools ;;;; -;;;; Copyright (C) 1997,2001,2002,2010,2011,2012,2013,2014,2019 Free Software Foundation, Inc. +;;;; Copyright (C) 1997,2001,2002,2010,2011,2012,2013,2014,2019,2020 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -188,7 +188,7 @@ for ‘build-uri’ except there is no scheme." (define ipv4-regexp (make-regexp (string-append "^([" digits ".]+)$"))) (define ipv6-regexp - (make-regexp (string-append "^([" hex-digits ":.]+)$"))) + (make-regexp (string-append "^([" hex-digits "]*:[" hex-digits ":.]+)$"))) (define domain-label-regexp (make-regexp (string-append "^[" letters digits "]" |