original commit: 67278507ce52b2bb29918ce96354d8aefb15d029
This commit is contained in:
Matthew Flatt 2003-07-19 13:02:18 +00:00
parent 3ed7326991
commit 3bc2686e33
2 changed files with 18 additions and 0 deletions

View File

@ -14,6 +14,7 @@
netscape/string->url ;; (string -> url)
string->url ;; str -> url
url->string
decode-some-url-parts ;; url -> url
call/input-url ;; url x (url -> in-port) x
;; (in-port -> T)
;; [x list (str)] -> T

View File

@ -13,6 +13,7 @@
(require (lib "file.ss")
(lib "unitsig.ss")
(lib "thread.ss")
"uri-codec.ss"
"url-sig.ss"
"tcp-sig.ss")
(provide url@)
@ -493,6 +494,22 @@
(get-str 4 0 1) ; user
))
(url-error "Invalid URL string: ~e" str))))))))
(define (decode-some-url-parts url)
(let ([uri-decode/maybe
(lambda (f)
(and f (uri-decode f)))])
(make-url/user (uri-decode/maybe (url-scheme url))
(uri-decode/maybe (url-host url))
(uri-decode/maybe (url-port url))
(uri-decode/maybe (url-path url))
(url-params url)
(url-query url)
(uri-decode/maybe (url-fragment url))
(if (url/user? url)
(uri-decode/maybe (url/user-user url))
#f))))
#|
Old version. See PR 6152 for information on its replacement.