more uri-related ipv6 fixes
authorAndy Wingo <wingo@pobox.com>
Fri, 6 Jul 2012 11:13:19 +0000 (13:13 +0200)
committerAndy Wingo <wingo@pobox.com>
Fri, 6 Jul 2012 11:13:19 +0000 (13:13 +0200)
commit3fabb2d2be8379ba61d0b4ab742c0a1e63638b69
treec4749ea03a29cad8c55dff4b6a491d00b17fe79d
parent81e7210f1427d5209357cbcb241e22ce278dd73e
more uri-related ipv6 fixes

* module/web/uri.scm (ipv6-regexp): IPv6 numeric addresses do not have
  brackets.  It's only in URIs that they have them.
  (ipv6-host-pat, authority-regexp, parse-authority): Refactor ipv6
  detection to fix a bug with |, and to extract IPv6 hosts from their
  brackets.  This way we can pass the uri-host directly to inet-pton.
  (uri->string): If the host contains a `:', assume it is ipv6 and add
  brackets.

* test-suite/tests/web-uri.test ("build-uri"): Adapt tests to assume
  that the address returned by uri-host and passed to build-uri #:host
  does not have brackets.
module/web/uri.scm
test-suite/tests/web-uri.test