]> gitweb.factorcode.org Git - factor.git/commitdiff
http.client: support urls without protocols (in addition to strings).
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 15 Jul 2013 17:28:28 +0000 (10:28 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 15 Jul 2013 17:28:28 +0000 (10:28 -0700)
basis/http/client/client.factor

index 0f9cbc448cecc33f0a7e70c340c0f3b356106f0b..1799485e432bacfd4a376525b28acc74fc508acb 100644 (file)
@@ -142,7 +142,8 @@ SYMBOL: redirects
 
 : request-url ( url -- url' )
     dup >url dup protocol>> [ nip ] [
-        drop "http://" prepend >url
+        drop dup url? [ present ] when
+        "http://" prepend >url
     ] if ensure-port ;
 
 : <client-request> ( url method -- request )