diff --git a/scheme/lib/uri.scm b/scheme/lib/uri.scm index f9ed13c..1b38f8a 100644 --- a/scheme/lib/uri.scm +++ b/scheme/lib/uri.scm @@ -16,6 +16,8 @@ (define uri-reserved (string->char-set ";/#?: =")) +(define uri-reserved-sans-= (char-set-delete uri-reserved #\=)) + (define (parse-uri s) (let* ((slen (string-length s)) ;; Search forwards for colon (or intervening reserved char). @@ -29,10 +31,10 @@ ;; Search backwards for ? (or intervening reserved char). ;; (NB: #\= may be after #\? and before #\#) - (rs-penult (string-index-right - s - (char-set-delete uri-reserved #\=) - (or sharp slen))) + (rs-penult (string-index-right s + uri-reserved-sans-= + path-start + (or sharp slen))) (ques (and rs-penult (char=? (string-ref s rs-penult) #\?) rs-penult)) (path-end (or ques sharp slen)))