use string-join
svn: r16700 original commit: e65ab46bfdb30cdd93b4fad32682e5f83c3151e1
This commit is contained in:
parent
1430191e51
commit
d9ebe60c72
|
@ -11,7 +11,7 @@
|
||||||
;; "impure" = they have text waiting
|
;; "impure" = they have text waiting
|
||||||
;; "pure" = the MIME headers have been read
|
;; "pure" = the MIME headers have been read
|
||||||
|
|
||||||
(require scheme/port
|
(require scheme/port scheme/string
|
||||||
"url-structs.ss"
|
"url-structs.ss"
|
||||||
"uri-codec.ss"
|
"uri-codec.ss"
|
||||||
"url-sig.ss"
|
"url-sig.ss"
|
||||||
|
@ -433,21 +433,13 @@
|
||||||
|
|
||||||
(define (combine-path-strings absolute? path/params)
|
(define (combine-path-strings absolute? path/params)
|
||||||
(cond [(null? path/params) ""]
|
(cond [(null? path/params) ""]
|
||||||
[else (let ([p (join "/" (map join-params path/params))])
|
[else (let ([p (string-join (map join-params path/params) "/")])
|
||||||
(if absolute? (string-append "/" p) p))]))
|
(if absolute? (string-append "/" p) p))]))
|
||||||
|
|
||||||
(define (join-params s)
|
(define (join-params s)
|
||||||
(join ";" (map path-segment-encode
|
(string-join (map path-segment-encode
|
||||||
(cons (path/param-path s) (path/param-param s)))))
|
(cons (path/param-path s) (path/param-param s)))
|
||||||
|
";"))
|
||||||
(define (join sep strings)
|
|
||||||
(cond [(null? strings) ""]
|
|
||||||
[(null? (cdr strings)) (car strings)]
|
|
||||||
[else
|
|
||||||
(let loop ([strings (cdr strings)] [r (list (car strings))])
|
|
||||||
(if (null? strings)
|
|
||||||
(apply string-append (reverse r))
|
|
||||||
(loop (cdr strings) (list* (car strings) sep r))))]))
|
|
||||||
|
|
||||||
(define (path->url path)
|
(define (path->url path)
|
||||||
(let ([url-path
|
(let ([url-path
|
||||||
|
|
Loading…
Reference in New Issue
Block a user