Skip to content

Commit 7c8271c

Browse files
committed
Make resolve-uri work with types other than string.
1 parent d815653 commit 7c8271c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/org/bovinegenius/exploding_fish.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ this document: http://www.ics.uci.edu/~fielding/url/test2.html"
522522
;; need to handle this case separately:
523523
;; resolve-uri "http://a/b/c" "//c"
524524
;; since path is nil, the resolve fails
525-
(if (re-find #"^//" target-uri)
525+
(if (re-find #"^//" (str target-uri))
526526
(scheme target-uri
527527
(scheme src-uri))
528528
(-> src-uri

test/org/bovinegenius/uri_test.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,12 @@
248248
"http://a/g"))
249249
(is (= (resolve-uri the-base-uri "//g")
250250
"http://g"))
251+
(is (= (resolve-uri the-base-uri (URI. "//g"))
252+
(URI. "http://g")))
251253
(is (= (resolve-uri the-base-uri "g?y")
252254
"http://a/b/c/g?y"))
255+
(is (= (resolve-uri (URI. the-base-uri) "g?y")
256+
(URI. "http://a/b/c/g?y")))
253257
(is (let [resolved-uri (resolve-uri the-base-uri "g?y/./x")]
254258
(or (= resolved-uri "http://a/b/c/g?y/./x")
255259
(= resolved-uri "http://a/b/c/g?y/x"))))

0 commit comments

Comments
 (0)