mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 21:59:17 +02:00
Fixing bug in uri path parsing.
This commit is contained in:
parent
e464f30ba2
commit
a1e22d42d4
2 changed files with 14 additions and 5 deletions
|
@ -94,11 +94,11 @@
|
|||
(end (string-cursor-end str))
|
||||
(colon0 (string-find str #\:))
|
||||
(colon
|
||||
(and (string-cursor>=?
|
||||
(if (string-cursor>=?
|
||||
(string-find str char-uri-scheme-unsafe? start colon0)
|
||||
colon0)
|
||||
(string-cursor<? colon0 end)
|
||||
colon0)))
|
||||
colon0
|
||||
end)))
|
||||
(if (string-cursor>=? colon end)
|
||||
(and scheme
|
||||
(let* ((quest (string-find str #\?))
|
||||
|
|
|
@ -53,4 +53,13 @@
|
|||
(test '(("a" . "1") ("b" . "2 2") ("c" . "3"))
|
||||
(uri-query (string->uri "http://google.com/%73?a=1&b=2+2;c=%33" #t #t)))
|
||||
|
||||
(let ((str "/"))
|
||||
(test-assert (uri? (string->path-uri 'http str)))
|
||||
(test 'http (uri-scheme (string->path-uri 'http str)))
|
||||
(test #f (uri-host (string->path-uri 'http str)))
|
||||
(test #f (uri-port (string->path-uri 'http str)))
|
||||
(test "/" (uri-path (string->path-uri 'http str)))
|
||||
(test #f (uri-query (string->path-uri 'http str)))
|
||||
(test #f (uri-fragment (string->path-uri 'http str))))
|
||||
|
||||
(test-end)
|
||||
|
|
Loading…
Add table
Reference in a new issue