Making uri-resolve work with bare local paths.

This commit is contained in:
Alex Shinn 2015-04-08 23:04:48 +09:00
parent 4e5cdedc03
commit 55329e39fb

View file

@ -331,13 +331,14 @@
;;> any components of \var{path} are missing, or if \var{path} is a ;;> any components of \var{path} are missing, or if \var{path} is a
;;> raw path, it is taken relative to \var{uri}. ;;> raw path, it is taken relative to \var{uri}.
(define (uri-resolve path uri) (define (uri-resolve path orig-uri)
(or (string->uri path) (or (string->uri path)
(let ((uri (string->uri uri))) (let ((uri (string->uri orig-uri)))
(and uri (if uri
(uri-with-path (uri-with-path
(uri-with-fragment (uri-with-query uri #f) #f) (uri-with-fragment (uri-with-query uri #f) #f)
(path-resolve path (path-resolve path
(if (string-suffix? (uri-path uri) "/") (if (string-suffix? (uri-path uri) "/")
(uri-path uri) (uri-path uri)
(path-directory (uri-path uri))))))))) (path-directory (uri-path uri)))))
(path-resolve path orig-uri)))))