Changeset 36543 in project


Ignore:
Timestamp:
09/08/18 11:46:01 (11 days ago)
Author:
sjamaan
Message:

uri-generic: Fix handling of ipv-future addresses

There were two problems with this:

  • We bailed out early with an error while attempting to parse an ipv6 address (which an ipv-future address is not)
  • The set of characters contained a typo: it had a semicolon instead of a colon.
  • The future address wasn't kept around fully: we threw away the prefix consisting of a "v", a hexdigit and a dot.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-generic/trunk/uri-generic.scm

    r36541 r36543  
    616616
    617617(define (ipv-future s)
    618   (match s ((#\v (? hexdigit-char?) #\. . rst)  (ipv-future0 rst))
     618  (match s ((#\v (and a1 (? hexdigit-char?)) #\. . rst)
     619            (match (ipv-future0 rst)
     620              ((ar rst) (list (append (list #\v a1 #\.) ar) rst))
     621              (else #f)))
    619622         (else #f)))
    620623
    621624(define char-set:ipv-future
    622   (char-set-union char-set:uri-unreserved char-set:sub-delims (char-set #\;)))
     625  (char-set-union char-set:uri-unreserved char-set:sub-delims (char-set #\:)))
    623626
    624627
     
    727730                               (list (append (concatenate a1) (list #\: #\:)) rst))
    728731                              (else #f)))
    729               (else #f))
    730       (uri-error 'ipv6-address "malformed ipv6 address" (try-ip-literal->string s))))
     732              (else #f))))
    731733
    732734
Note: See TracChangeset for help on using the changeset viewer.