From 3429b461cfa4ee2bae70eea15aff8b38de1d7810 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 28 Jul 2002 03:34:24 +0000 Subject: [PATCH] . original commit: 0f85816e7273b60c26b27e7dd4972101be3469cc --- collects/net/url-unit.ss | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/collects/net/url-unit.ss b/collects/net/url-unit.ss index 758ceef..5dd05d0 100644 --- a/collects/net/url-unit.ss +++ b/collects/net/url-unit.ss @@ -157,7 +157,10 @@ (when (url-host url) (url-error "Don't know how to get files from remote hosts")) (open-input-file (url-path url)))) - + + (define (schemeless-url url) + (url-error "Missing protocol (usually \"http:\") at the beginning of URL: ~a" url)) + ;; get-impure-port : url [x list (str)] -> in-port (define get-impure-port (case-lambda @@ -166,7 +169,7 @@ (let ((scheme (url-scheme url))) (cond ((not scheme) - (url-error "Scheme unspecified in ~a" url)) + (schemeless-url url)) ((string=? scheme "http") (http://get-impure-port url strings)) ((string=? scheme "file") @@ -182,7 +185,7 @@ (let ((scheme (url-scheme url))) (cond ((not scheme) - (url-error "Scheme unspecified in ~a" url)) + (schemeless-url url)) ((string=? scheme "http") (let ((port (http://get-impure-port url strings))) (purify-port port)