Changeset 13219 in project


Ignore:
Timestamp:
02/08/09 16:47:49 (11 years ago)
Author:
sjamaan
Message:

Make use of new relative-ref? predicate, for now

Location:
release/4/uri-common/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-common/trunk/tests/run.scm

    r13176 r13219  
    1111     ("http://a:8080" 8080)
    1212     ("https://a" 443)
    13      ("https://a:1" 1))
     13     ("https://a:1" 1)
     14     ("//a" #f))
    1415    ("username" ,uri-username
    1516     ("//foo" #f)
     
    3233     ("http://foo" (/ ""))
    3334     ("http://foo/" (/ ""))
    34      ("//foo" (/ ""))
     35     ("//foo" ()) ; Correct? No scheme, so we can't know normalization rules
    3536     ("//foo/" (/ ""))
    3637     ("foo%20bar" ("foo bar"))
  • release/4/uri-common/trunk/uri-common.scm

    r13216 r13219  
    119119(define (uri-path uc)
    120120  (let ((path (URI-common-path uc)))
    121     ;; does not apply for relative references
    122     ;; XXX: Make a "relative-ref?" predicate (or something like that)
    123     (if (and (uri-host uc)
    124              (or (eq? path '()) (eq? path #f)))
     121    ;; XXX change (not (relative-ref? uc)) to a real-URI? (bad name) predicate
     122    (if (and (not (relative-ref? uc)) ; For real URIs (not relative-refs),
     123             (or (null? path)         ; an empty path equals a path of "/"
     124                 (eq? path #f)))      ; as per RFC 3986, section 6.2.3
    125125        '(/ "")
    126126        path)))
Note: See TracChangeset for help on using the changeset viewer.